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 / Set DisplayMode to Edi...
Power Apps
Unanswered

Set DisplayMode to Edit only if user has security role to update

(0) ShareShare
ReportReport
Posted on by 2

I have a combo box.  If the current user does not have a security role to update the table linked to the combo box, is there a good way to set the combobox to displaymode.view ?

 

I was thinking I could run a Patch command on the table when the screen onVisible, and ifError then set a flag and set displaymode.View? Not sure if I can patch without really updating the table as this is only to test if it works.

 

Or I could check to see if the user is in one of the securityRoles that has access, but these can change (I may need to add new security roles later).

 

Any thoughts are appreciated

Thanks

Dave

 

Categories:
I have the same question (0)
  • wolenberg_ Profile Picture
    1,476 Super User 2026 Season 1 on at

    Hi @Testy123  ,

    You can use a If statement inside the property "DisplayMode" for the combobox control.

    Here it some example:

    If(Lookup(TableRole, User = User().ID).NameofRole = "Admin", Displaymode.Edit, DisplayMode.View)

     

     

    -------------------------------------------------------------------

    If my reply helped you, please give a 👍
    If it solved your issue, please give a 👍 & accept it as the Solution to help other community members find it.

  • AllanDeCastro Profile Picture
    412 Most Valuable Professional on at

    Hello,

    I think you can leverage the DataSourceInfo formula: DataSourceInfo function !

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 305 Most Valuable Professional

#2
11manish Profile Picture

11manish 212

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard