web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Best way to Use Countr...
Power Apps
Unanswered

Best way to Use Country Flags in PowerApps?

(0) ShareShare
ReportReport
Posted on by 137

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?

Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    on at

    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!

  • MP-23041215-0 Profile Picture
    7 on at

    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.

    flags1.gif

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard