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!
@Gochix Okay, that's actually kinda genius and worked seamlessly for me. Thanks so much for your help!
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!
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?
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!
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional