web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Lookup User for View/Edit
Power Apps
Unanswered

Lookup User for View/Edit

(0) ShareShare
ReportReport
Posted on by 22

 

Hello, Please suggest if i would like only Admin Role able to edit form. Another question, can i lookup the Role from Office365Users instead of create a Datatable?

 

DataTable : RexUsers

Column : Email, Role

 

Below is the formula i have tried:

Set(varRecord, LookUp(RexUsers,Email = varUser.Email));

If(IsBlank(varRecord),EditForm(StockCard1));

Navigate(StockCard);

 

Thank you.

Categories:
  • ivan_apps Profile Picture
    2,189 Moderator on at

    Ok I assume you are defining users and roles in that table, but it is limited to a single role? If it is you could use the below:

    Set(varUser, LookUp(RexUsers, Email = User().Email, Role = “Admin”))

    Set(isAdmin, If(IsBlank(varUser), false, true));

     

    On your form’s FormMode property set the following value:

    If(isAdmin, FormMode.Edit, FormMode.View)

     

    Yes you can use Office365 Users to retrieve user data, if you have the permissions to add new fields to it you could do that, but personally I would rather make a local list of only Administrators of my app and when the user logs in, check to see if their email shows up in my admins list.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard