Hi PowerApps,
I am developing an app for users to request access to a Blocked Microsoft Location so they can sign in to M365.
On the App, the user creates a request and if they select "France" I would like the France flag to save as an image to the SharePoint List with that request record so that in the Requests Gallery you can see the Flag as the image.
I also have an admin section where admins can add new Blocked Countries to the List - I would like them to be able to add the Country name and image flag to the "Blocked Locations" SP list i have set up.
I have been working away trying to get a solution but I cant seem to get either of these.
Can anyone help?
Solved! Go to Solution.
You don't need to add the country image to the SharePoint list; instead, you can have a collection locally in your app that correlates the countries with their respective images. For example, if you have this in your App's OnStart property:
ClearCollect(
CountryFlags;
{ Name: "France", Flag: "https://upload.wikimedia.org/wikipedia/en/thumb/c/c3/Flag_of_France.svg/1280px-Flag_of_France.svg.png" },
{ Name: "Azerbaijan", Flag: "https://upload.wikimedia.org/wikipedia/commons/thumb/7/74/Flag_of_Azerbaijan_%283-2%29.svg/1280px-Flag_of_Azerbaijan_%283-2%29.svg.png" },
{ Name: "Bulgaria", Flag: "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Flag_of_Bulgaria.svg/1920px-Flag_of_Bulgaria.svg.png" },
{ Name: "Germany", Flag: "https://upload.wikimedia.org/wikipedia/en/thumb/b/ba/Flag_of_Germany.svg/1280px-Flag_of_Germany.svg.png" })
You can have in your gallery's image an expression that performs a LookUp in that collection, something like
LookUp(CountryFlags, Name = ThisItem.Country, Flag)
If you need to use this "flag lookup" in other apps you can also have it as an Excel table (that is imported statically to the app) or even in a separate SharePoint list.
The attached app shows an example of this technique. To open it, save it locally, then go to https://create.powerapps.com, select Open, Browse, and find the file that you previously saved.
Hope this helps!
You don't need to add the country image to the SharePoint list; instead, you can have a collection locally in your app that correlates the countries with their respective images. For example, if you have this in your App's OnStart property:
ClearCollect(
CountryFlags;
{ Name: "France", Flag: "https://upload.wikimedia.org/wikipedia/en/thumb/c/c3/Flag_of_France.svg/1280px-Flag_of_France.svg.png" },
{ Name: "Azerbaijan", Flag: "https://upload.wikimedia.org/wikipedia/commons/thumb/7/74/Flag_of_Azerbaijan_%283-2%29.svg/1280px-Flag_of_Azerbaijan_%283-2%29.svg.png" },
{ Name: "Bulgaria", Flag: "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Flag_of_Bulgaria.svg/1920px-Flag_of_Bulgaria.svg.png" },
{ Name: "Germany", Flag: "https://upload.wikimedia.org/wikipedia/en/thumb/b/ba/Flag_of_Germany.svg/1280px-Flag_of_Germany.svg.png" })
You can have in your gallery's image an expression that performs a LookUp in that collection, something like
LookUp(CountryFlags, Name = ThisItem.Country, Flag)
If you need to use this "flag lookup" in other apps you can also have it as an Excel table (that is imported statically to the app) or even in a separate SharePoint list.
The attached app shows an example of this technique. To open it, save it locally, then go to https://create.powerapps.com, select Open, Browse, and find the file that you previously saved.
Hope this helps!
Here is a blog post on how to do this.
https://medium.com/marek-pikosz/power-apps-display-any-countrys-flag-8b78c570b065
Above method allow to display any country flag without the need to have all flag images stored in Power Apps or database.
User | Count |
---|---|
121 | |
88 | |
88 | |
75 | |
66 |
User | Count |
---|---|
215 | |
180 | |
138 | |
96 | |
82 |