Hi All -
I'm new to Power Apps and am hoping someone can help. I have an app that's connected to a SharePoint site that contains two lists:
The Spend Admins list contains two columns:
In my app, I want to hide or display buttons depending on whether the logged in user's role is set to FIN or SCM. I'm thinking that I want to set a global variable in the Application OnStart to do the lookup once and assign the variable that I can then use throughout my app to set button Visible properties. I'm having difficulty with the syntax to set the global variable. Any help is greatly appreciated.
Solved! Go to Solution.
Hi @tsparkman ,
Something like this at App OnStart
Set(varUserMail,User().Email);
Set(
varRequestRole,
Lookup(
'Spend Request',
Title=varUserMail
).Role
);
Set(
varAdminRole,
Lookup(
'Spend Admins',
Title=varUserMail
).Role
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @tsparkman ,
Something like this at App OnStart
Set(varUserMail,User().Email);
Set(
varRequestRole,
Lookup(
'Spend Request',
Title=varUserMail
).Role
);
Set(
varAdminRole,
Lookup(
'Spend Admins',
Title=varUserMail
).Role
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Thank you @WarrenBelz!
This was exactly what I was looking for. One small change in case others a reading to find a similar solution. I had to put .Value after Role since it is a drop-down field.
Set(varUserMail,User().Email);
Set(
varAdminRole,
Lookup(
'Spend Admins',
Title=varUserMail
).Role.Value
)
User | Count |
---|---|
252 | |
250 | |
82 | |
45 | |
27 |
User | Count |
---|---|
349 | |
264 | |
127 | |
60 | |
58 |