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 / Add Time Zones for a l...
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!

Categories:
I have the same question (0)
  • Verified answer
    Gochix Profile Picture
    1,935 Moderator on at

    @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!

  • Hsnowbee Profile Picture
    34 on at

    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? 

  • Gochix Profile Picture
    1,935 Moderator on at

    @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

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

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard