cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Get media name dynamically from a service

Janicen
16-Pearl

Get media name dynamically from a service

Hello, community,

 

How can I get a media name in a script?  The aim is to get the descriptions of images from dynamic media. Meaning not just from one image but from different images. I have the code below, is there are snippets that I can use to achieve this?

 

// description: STRING
var mediaName = (a snippet required)
let description = MediaEntities["RampConveyor"].GetDescription();
let result = description;

 

your suggestions will really help thank you.

Jay_nisa

ACCEPTED SOLUTION

Accepted Solutions

Sathishkumar_C_0-1660623925581.png

you can pass dynamic media name as a service input. If this is not useful, please explain further on your usecase.

 

View solution in original post

3 REPLIES 3

MediaEntities[mediaName].GetDescription();

 

You can get a media description with above code.

 

Where are you from trying to get a dynamic media name?

Hi @Sathishkumar_C 

This does : 

            MediaEntities[mediaName].GetDescription(); is correct.

It gives me the description of the specific media. In the event where I would want to reuse this service to get the description for another media, I do not want to keep going back to change the media name. So my question is how can I get a media name for different media (images to be precise)? 

 

Sathishkumar_C_0-1660623925581.png

you can pass dynamic media name as a service input. If this is not useful, please explain further on your usecase.

 

Announcements


Top Tags