cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mahonebn Advocate II
Advocate II

If(Lookup Issue

I am trying to set a field that only shows if a user in a seperate table (nmAdmins) has a Status of "Contribute". Below is the code I am using, but it is not working. I have a red squiggly line under the equal sign between Status and Contribute. Does anybody know what I am doing wrong?

 

If(LookUp('nmAdmins',Email=User().Email).Status="Contribute",DisplayMode.Edit,DisplayMode.Disabled)

 

Many thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
mahonebn Advocate II
Advocate II

Re: If(Lookup Issue

I figured out what the issue with this is. The formula that I used was correct (below):

 

If(LookUp('nmAdmins',Email=User().Email).Status.Value="Contribute",DisplayMode.Edit,DisplayMode.Disabled)

 

However, the email address in my Lookup list did not match the email that User().Email generated in the form. In the form, there was some capitalization in the email that I wasn't aware of. Once I changed it to match exactly in the Lookup list, everything works perfectly!

View solution in original post

2 REPLIES 2
Community Support
Community Support

Re: If(Lookup Issue

 

Hi @mahonebn,

 

Where did you use this formula? If it's a Form/Gallery control, and the data source of Form/Gallery is not nmAdmins, then this error happens because that one Form/Gallery can only recognize one data source. That means that if you contain any other data sources in any part of the Form/Gallery, the formula won't work. 

 

So if the situation is like above, then I would suggest that you could add another display form control for the seperate table (nmAdmins). Suppose that in this nmAdmins form the name of the control that has the Email field value is "DataCardValue1", and the Status field is "DataCardValue2" then the formula should be:

 

If(DataCardValue1.Selected.Email=User().Email && DataCardValue2.Selected.Value=,DisplayMode.Edit,DisplayMode.View)

 

I have assumed that Email is a person and group field, and Status is a choice column in SharePoint.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mahonebn Advocate II
Advocate II

Re: If(Lookup Issue

I figured out what the issue with this is. The formula that I used was correct (below):

 

If(LookUp('nmAdmins',Email=User().Email).Status.Value="Contribute",DisplayMode.Edit,DisplayMode.Disabled)

 

However, the email address in my Lookup list did not match the email that User().Email generated in the form. In the form, there was some capitalization in the email that I wasn't aware of. Once I changed it to match exactly in the Lookup list, everything works perfectly!

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,886)