Skip to main content
Aug 15, 2022 2:37 PM UTC
Solved

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

Aug 16, 2022 4:29 AM UTC

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.

 

3 replies

Aug 15, 2022 2:55 PM UTC

MediaEntities[mediaName].GetDescription();

 

You can get a media description with above code.

 

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

JanicenAuthor
Aug 15, 2022 4:09 PM UTC

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)? 

 

Aug 16, 2022 4:29 AM UTC

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.