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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Make a button invisibl...
Power Apps
Unanswered

Make a button invisible depending on the user and form mode

(0) ShareShare
ReportReport
Posted on by 50

Hi,

 

I have 3 security groups:

1. Admin

2. Leadership

3. End User

 

On one of my screens, I want to make a button visible only when the form is in Edit mode and only for Admin and Leadership.

 

At the minute I'm using the following formula but it's not working as I can still see the button in Edit mode.

 

isUserInSPGroupAdmin || isUserInSPGroupEndUsers && Form1_1.Mode <> FormMode.Edit

 

Is there something wrong in the formula?

Categories:
I have the same question (0)
  • Sid_Jafri Profile Picture
    478 on at

    How did you assigned the users to the security group? It is a best practice to create Office 365 Security group and add people in there. E.g.

    Office365_Admin_Users

    Office365_Leadership_users

    Office365_End_Users

     

    You can lookup the login user in that group and if that exists then you can apply the above formula. There is a connector in PowerApps called Office 365 Groups that allows you to find people in there

    Please mark the solution accepted if that resolve the issue

  • EuniceG11 Profile Picture
    50 on at

    Hi. I've based my security groups off SharePoint list security settings.

  • Sid_Jafri Profile Picture
    478 on at

    Okay, so it is not a dataverse security. Do you have a Sharepoint list with the users and their access?

    You can set the variable when you are going to Edit the record
    Set(IsEditmode, true)

    Set visible property of Button
    (isUserInSPGroupAdmin || isUserInSPGroupEndUsers) && IsEditmode

    On form success, set the variable back to false
    Set(IsEditmode, false)

     

    Please accept the solution if your issue is resolved

  • EuniceG11 Profile Picture
    50 on at

    Thank you so much! With a little change, I was able to get it to work...

     

    On the Edit icon visible property, I put:

     

    FormWorkItem.Mode = FormMode.View && (isUserInSPGroupAdmin || isUserInSPGroupEndUsers)

  • Sid_Jafri Profile Picture
    478 on at

    I am glad you had a resolution.

     

    Please Thumbs up if my post helped you solve your issue

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard