cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
davidstone
Level 8

Weird bug with image resources

I'm trying to dynamically build a path to the resource for a particular Media object.

 

I worked out that I could concatenate "appres://resources/" along with some other letters which, strung together, point to one or another image. It's fairly rudimentary - it could be "EL_GR", and I'm just using a bunch of conditions to decide which letters to use.

 

When I put my formula into a label it correctly displays the full path to a valid resource, eg "appres://resources/EL_GR" - perfect.

 

Even better, I can put that formula into the 'Image' property of my media object - and it works! ...IN the desktop builder.

 

Once I publish, running on web or mobile, the media object no longer displays the actual image.

 

So to check it was still the same path on web and mobile, I placed a label and set its text value to simply 'EL_GR', directly referencing the media asset. On the app, it then displays the same resource path, as expected. So I published again, and all of a sudden the image now displays!

 

So in a sense I have a workaround - I can concat all my resources into a Label value and hide the label, and then everything is good.

 

But there's surely something wrong there for me to have to do this?

 

Thanks for any insight!

3 REPLIES 3
Meneghino
Level 10

Re: Weird bug with image resources

Hi @davidstone

I think the best way to resolve this is to load the images into a collection with a unique column to identify them.

Then you can dynamically look up the image.

Please let me know if you need details on this, but loading the collection is basically:

ClearCollect(MyImages,
  {Id:1, MyImage: ImageNameX},
  {Id:2, MyImage: ImageNameY},
 etc. etc.)
davidstone
Level 8

Re: Weird bug with image resources

Thanks.

 

How would I then reference the image I wanted to display?

Highlighted
Meneghino
Level 10

Re: Weird bug with image resources

You should use the following as the Image property of an image control

 

LookUp(MyImages, Id=YourParameter, MyImage)

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,865)