Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Add Time Zones for a list of users

(0) ShareShare
ReportReport
Posted on by 34

Hello, 

I built an org chart using Power Apps and I have been asked to add the time zone for each individual on the org chart, since we are dispersed throughout the country. My data sources are a Dataverse table and the Office 365 connector. Unfortunately, the OfficeLocation field in the Office 365 connector does not reflect a geographic location for our staff, only whether an individual works remotely or not.

 

Is there a way to capture the logged in user's location/time zone and use this to determine the location of the other users listed on the org chart in relation to the logged in user (e.g. Joe Smith is 2 hours behind you or Joe Smith is on Pacific Time). Or is there a better way to go about this?

 

Thanks!

  • Hsnowbee Profile Picture
    34 on at
    Re: Add Time Zones for a list of users

    @Gochix Okay, that's actually kinda genius and worked seamlessly for me. Thanks so much for your help!

  • Gochix Profile Picture
    1,933 Super User 2025 Season 1 on at
    Re: Add Time Zones for a list of users

    @Hsnowbee ,

     

    That's correct. You can patch the time zone whenever a user logs in, or do an If statement before the formula provided to check if the Time zone column is blank, then patch the time zone, if not, ignore the formula.


    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

  • Hsnowbee Profile Picture
    34 on at
    Re: Add Time Zones for a list of users

    Thank you @Gochix for the quick reply - and especially for demonstrating the formula for me! If I am understanding this correctly, when a user opens the app, the function will run with the App OnStart and patch their time zone to the Dataverse table. So, assuming everyone in the office logs in to the app at some point, I will eventually collect all of their time zones in my table. Is that correct? 

  • Verified answer
    Gochix Profile Picture
    1,933 Super User 2025 Season 1 on at
    Re: Add Time Zones for a list of users

    @Hsnowbee ,

     

    You could add on your OnStart property to set user's TimeZoneOffset in a new column in your User List.

     

     

    Patch(
     UserList,
     LookUp(
     UserList,
     Name = User().FullName
     ),
     {
     Time: "UTC" & If(
     TimeZoneOffset() > 0,
     "-",
     "+"
     ) & RoundDown(
     Abs(TimeZoneOffset()) / 60,
     0
     ) & ":" & If(
     Mod(
     Abs(TimeZoneOffset()),
     60
     ) < 10,
     "0",
     ""
     ) & Mod(
     Abs(TimeZoneOffset()),
     60
     )
     }
    )

     

     

     

    To get the Location, you could use the Location function, but this would only give you the Longitude and Latitude.

    You could then use the Map if you have a premium license to display the user's location.
    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard