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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Engage with the Community
Answered

Best way to determine a user's country inside Power Apps?

(2) ShareShare
ReportReport
Posted on by 17

I'm building a Power App that needs to show different content depending on the user's country.

The obvious approach is to ask users to select their location manually, but that creates extra friction and often results in incorrect data.

Has anyone implemented automatic country detection within Power Apps or Power Automate? Did you use Microsoft services, a custom connector, or an external data source?

I'm particularly interested in solutions that work reliably for remote users and don't require manual user input.

I have the same question (0)
  • Verified answer
    Kalathiya Profile Picture
    2,372 Super User 2026 Season 1 on at
     
    You can use the Office 365 connector in the app. It returns the current logged-in user’s details from the Azure AD (Entra ID) profile, such as country, city, date of birth, and other available properties.
     
    It will return current login user country name:
    Office365Users.MyProfileV2().country
    Basically you need to add Office 365 Users connector in app.
     
    ---------------------------------------------------------------------------
    Glad it helped 🙂
    If this fixed your issue,
    please click “Does this answer your question?” to mark it as verified so others can find the solution easily.
    A Like 👍 is always appreciated, and I’m around if you need more help @Kalathiya
  • Verified answer
    MS.Ragavendar Profile Picture
    7,278 Super User 2026 Season 1 on at
     
    You can use the Office 365 Users connector to pull the user information
     
    Office365Users.MyProfile().Country /  Office365Users.MyProfile().OfficeLocation
     
     
    Note : But it depends on AD data quality if all the data is sync you may get the data if data is not available it will give empty value only.
     
    Another approach you can use  Location.Latitude & Location.Longitude to determine the location of the user for that location permission needs to be provided.
     
     
     
    ✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated 🏷️ Tag @MS.Ragavendar for follow-ups.
     
     
  • furqan-ashraf Profile Picture
    17 on at

    Thanks for the suggestions.

    Using the Office 365 Users connector looks like the simplest approach for my use case, and I wasn't aware that the country field could be retrieved directly from the user's profile. The note about data quality in Entra ID is also helpful and something I'll need to verify in our environment.

    I appreciate both of you sharing the different options and considerations. This gives me a clear path forward.

  • Suggested answer
    Haque Profile Picture
    3,389 on at
     
    If you don't want to use Office365Users.MyProfile().Country /  Office365Users.MyProfile().OfficeLocation, another option is use Lanuguage function with bit of manipulation.
     
    At App OnStart - you can use a variable like this to pickup the countyr code and can use a bit of translation where you want to show.
     
     
     
     
    Please note that Language() function retrieves lang-country code tag from:
     
    1. In a browser: It uses the browser’s language/locale settings (usually the browser’s preferred language or the operating system locale that the browser inherits).
    2. In the Power Apps mobile app: It uses the device’s language and regional settings.
    3. In desktop or other hosts: It uses the host OS locale or app environment settings.

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
     
     
     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Engage with the Community

#1
Vish WR Profile Picture

Vish WR 33

#2
furqan-ashraf Profile Picture

furqan-ashraf 17

#3
Bezanca Profile Picture

Bezanca 12 Super User 2026 Season 1

Last 30 days Overall leaderboard