Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hey guys,
I've reviewed some posts in the forums that are relevant to my issue - Such as "How to set image in media entity dynamically?" that was posted by done11. I am currently facing an issue with my dynamic media entity.
I have followed this code snippet:
var params = {
url: 'https://pbs.twimg.com/profile_images/447374371917922304/P4BzupWu.jpeg' /* STRING */,
};
// result: IMAGE
var image = Resources["ContentLoaderFunctions"].LoadImage(params);
var params = {
name: 'TestMedia'/* STRING */,
content: image
};
// no return
Resources["EntityServices"].UpdateMediaEntity(params);
I have set up a template thing that is referencing a file repository base thing template, then I proceeded to create a thing with the service(baseType ImageLink) mentioned above. I created a "dynamic" media entity that has a corresponding name to my service. I bound the service from my thing to the media entity but I have no image displaying currently upon runtime.
I have also tried changing the baseType to Image and linking the data to a value display, but this method did not work either.
Here are the errors that I receive:
Any help would be appreciated.
Thanks.
Is there a specific reason you're trying to use a media entity when you can just use an image widget and bind the output of your service (with a few modifications) to the image widget?