cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
abd3127
Kudo Kingpin
Kudo Kingpin

Checking if the current logged in user is present in People/Group column of SP List

Hello team

 

 I am having a SP List in which i have a people column is present, which contains multiple users.

Now i want to check if the current logged in user is present in this column.

Filter('Support List', User().Email in Reviewer.Email)

By using this formula i am able to check if the user is present or not.

But what i want to do is change the display mode of a control from edit to disabled or disable to edit 

How can i do this?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @abd3127,

 

Do you want to change the mode of the control into edit when the current login user is present in the Person/Group column of your SP list?

Further, could you please share a bit more about your PowerApps app's configuration?

 

I agree with @DavesTechTips's thoght almost, I assume that you want to change the mode of the control into edit when the current login user is present in the Person/Group column of your SP list, please take a try with the following workaround:

  • Set the DisplayMode property of the Control to the following formula:
If(IsEmpty(Filter('Support List', User().Email in Reviewer.Email))=true,DisplayMode.Disabled,DisplayMode.Edit)

More details about the IsEmpty function in PowerApps, please check the following article:

IsEmpty function

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
DavesTechTips
Super User
Super User

Hi @abd3127

 

Nice work.

 

You can specify this formula in the DisplayMode property of the input control.

 

IsEmpty(Filter('Support List', User().Email in Reviewer.Email), DisplayMode.Disabled , DisplayMode.Edit )

Let me know if you don't come right.

v-xida-msft
Community Support
Community Support

Hi @abd3127,

 

Do you want to change the mode of the control into edit when the current login user is present in the Person/Group column of your SP list?

Further, could you please share a bit more about your PowerApps app's configuration?

 

I agree with @DavesTechTips's thoght almost, I assume that you want to change the mode of the control into edit when the current login user is present in the Person/Group column of your SP list, please take a try with the following workaround:

  • Set the DisplayMode property of the Control to the following formula:
If(IsEmpty(Filter('Support List', User().Email in Reviewer.Email))=true,DisplayMode.Disabled,DisplayMode.Edit)

More details about the IsEmpty function in PowerApps, please check the following article:

IsEmpty function

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Just to let you know this has been an enormous help to me!   Worked perfectly!  I'd never have figured it out myself! 

Hi! I'm having a similar issue but I want to set the control on Edit when the user using the list form is a member of an specific O365 group. 

 

I'm using the Azure AD connector but I can't seems to figure out how to use it's functions to make this work.

 

If("3a0e0fa1-285a-4b6d-91e3-3dd5cd38a5ee" in AzureAD.CheckMemberGroups(UsuariosdeOffice365.MyProfile().Id;
        Table({Value: "3a0e0fa1-285a-4b6d-91e3-3dd5cd38a5ee"}));
        Set(VarAsignadora; "Jefe")

        )

Was using that on the OnEdit property and worked but in the dispplaymode value of a button it doesnt't

Hello @v-xida-msft

 

I attempted to use your solution;

If(IsEmpty(Filter('Support List', User().Email in Reviewer.Email))=true,DisplayMode.Disabled,DisplayMode.Edit)

But changed it a bit to check if the current user is in the Requestor column in another list and if so change a toggle to true; the list I am looking at through a datasource collection is called 'Non Standard Approver' and the column i'm looking at is called Requestor (people picker, no multi selections, with presence)

 

Here is what I am using on the toggle default property;

If(IsBlank(Filter('Non Standard Approver', User().Email in Requestor.Email))=false,true,false)

 

The Toggle has a warning on it stating;

DWTKBrook_1-1675273145475.png

Im not sure to fix this.

 

Any help would really be appreciated.

 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,235)