cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mahonebn
Level: Powered On

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
Level: Powered On

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 Team
Community Support Team

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
Level: Powered On

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,766)