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 Automate / get user location and ...
Power Automate
Unanswered

get user location and set timezone of the site collection using flow!!

(0) ShareShare
ReportReport
Posted on by 134

Greeting of the day,

 

I am fairly new with MS flow, please forgive me if my question sounds silly.

I have create a self service site provisioning engine using MS Flow, Azure function and pnp powershell, all working good.

 

at the moment i am passing the timezone of the user from a sharepoint configuration list by letting users select the location from a dropdown on the request form which is looked-up with a timezone id.

 

Problems Below:-

1- Business need user's location to come from user profie 'officelocation' property.
I tried using office 365 user connector but didn't get any success (may be an example will do) 😞

2- I have to set the site regional setting i.e. timezone based on user's location. is there any built in connector to achieve or any suggestion or example would be great?

Please show me some light on these issues.


Your help would be highly appreciated on this matter.

Thank you!

Categories:
I have the same question (0)
  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at

    @vermaaman 

    Hi there!  So, I was surprised to see that the timezone didn't come over with the Get User Profile connector on O365.  Might be worth submitting an idea.

    If you use PowerApps as your front end, then you can grab the user location from their mobile device pretty easily.  Not sure if that's an option.

    Another thought is that since you're already doing PowerShell stuff, maybe there's a way to use the Get-TimeZone cmdlet and bring that back into Flow.

     

    Keep us posted either way.

    -Ed-

     

     

    If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

  • vermaaman Profile Picture
    134 on at

    Thank you for the response, 

     

    Get-TimeZone cmdlet works only on local machine where as i am running powershell inside azure function, so that option i have to eleminate unless one can prove me wrong on that. 

     

    as for getting user's current location using mobo device may not be feasible at all times specially when user users powerapp only on computers. 

     

    is there any other way in powerapps which can help us get that?


  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at

    Ah, good to know.  I think PowerApps will grab whatever location data is available...so if there's no gps, it may 'guess' based on ip address or something.

     

    I did see that Office Location and Postal Code come through.  That gives us a couple of options.  The easiest might be an API that translates zip codes to time zones.  This one looks promising...if that works, you can use the HTTP GET to grab the timezone and try that.

     

    Another option might be to keep a SP list or a table that translates that for you.  Downside is populating/maintaining that data.

     

    Keep us posted.

    -Ed-

     

     

    If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

  • Verified answer
    vermaaman Profile Picture
    134 on at

    Thank you @edgonzales for the inputs, 

     

    i was able to get the current user's location using Office365User.myprofile().city in powerapps and then converted the city name into timezone using pnpcmdlet (That i am running inside azure function) $Timezone = Get-PnPTimezoneId $Cityname >> $Id = $Timezone.Id and passed into my provisioning engine to apply required timezone on the site.

     

    Thank you very much for the inputs

  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at

    Awesome work!  I think you can mark your own post as the solution, so make sure you do that so others having the same trouble can benefit from your brain.  Robot Happy

     

    -Ed-

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard