
Announcements
Hi,
I'm having a column i.e IconName in DB and giving the image name there. like abc
and also having abc.png image in my powerApps media.
But when I'm trying to fetch the image, it is not showing in the gallery.
The code I'm writing is: LookUp(TblImage, Id = ThisItem.Id,IconName)
By doing below approach, I'm getting images, but I don't want to use it (as the link change frequently)
"appres://resources/" & LookUp(TblImage, Id = ThisItem.Id,IconName)
and I don't want to give data manually, as data is changing again & again.
Is there any other solution which can be used?
Thanks
Based on the information you provided, it seems that the issue may be related to how the image URL is being constructed in PowerApps.
When using the "LookUp" function to retrieve the value of the "IconName" field from the "TblImage" table, the value returned is just the name of the image file (e.g. "abc"). However, in order to display the image in a gallery, you need to provide the full URL of the image file.
One way to construct the image URL dynamically is to use the Concat function to concatenate the base URL of your app's media library with the value of the "IconName" field. For example:
Concat("https://yourappnamehere.azureedge.net/", LookUp(TblImage, Id = ThisItem.Id, IconName), ".png")Note that in the example above, I assumed that your app's media library is hosted on Azure and the image files have the ".png" extension. You will need to adjust the URL and file extension accordingly to match your specific configuration.
By using this approach, you can dynamically construct the image URL based on the value of the "IconName" field in your database without having to hard-code the URL or data manually.
I hope this helps. Please consider accepting this solution.
Thanks