Announcements
Hi all,
I have a button which I only want displayed if the User (from the O365 connector) is on a "PrivilegedUsers" Dataverse table, in it's Name column.
Does anyone have any code of how I do this? I am thinking something like If(LookUp..... and then I'm lost...
Thanks
K.
Email column is better suited for this since emails will be unique:
App.OnStart:
Set(varEmail,Office365User.MyProfileV2().Mail);
Set(IsUser,LookUp(Table,Email=varEmail));
On Button visible property:
!IsBlank(IsUser)
this code will check the table if currently logged in user is in the list. If he is there it will store that record in the variable. ON the button visible it will only show button if that variable is not blank
Thank you so much.
There is another button where it should be displayed for all, but only selectable for those in the varEmail variable. How would this work?
Button DisplayMode property:
If(IsBlank(varEmail),DisplayMode.Disable,DisplayMode.Edit)
Thanks, but that is generating an error - "The function If has some invalid arguments" ??
You need to write this code on button DisplayMode property. It won't work on anywhere else. Show pictures
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 402 Super User 2026 Season 2
Mohsin Ali 328
WarrenBelz 296 Most Valuable Professional