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

Disable checkbox based on filtered lookup

I have a checkbox that I need to disable based on multiple values in a library. Here is my scenario. I have a SharePoint library (SPLibrary) with a column named "Category". This column is used to store attachments for my app. For example, on submission could be for a category of "Paper". Another could be for a category of "Products". The variable, varSubmissionID, is set on app start is is basically the submission from the current logged in user. That is how I am matching up records.

 

This works fine for the first category but it is not looping through the entire library.

If(LookUp(SPLibrary, ID=varSubmissionID).Category<>"Product" && LookUp(SPLibrary, ID=varSubmissionID).Category<>"Paper",Disabled,Edit)

 

I need to be able to disable this control if both conditions are not met. Is this possible?

4 REPLIES 4
Helper IV
Helper IV

What is your column type? For example if it is a calculated field, you may need to get its Value rather than directly comparing with text. Test by setting up a variable and looking into the value you get. 

@AmirBakht , it's a text column

Can you give more info on what you mean by looping through the library? Your formula works on a single item entry for the same column. LookUp also gets you only a single entry even if it matches multiple values, though I believe you are looking at a single entry here since ID is being queried. It will lookup the first entry it finds where the ID is equal to your variable then disable the control if the value is anything other than Paper or Product and keep it editable if it is Paper or Product. I'd still say set the value to a variable and check, it will give you an idea of what value you are testing and you would also reduce 2 queries to 1 query.

@AmirBakht, by looping through I mean look at all items in the library and if any item with category column that matches "Paper" AND "Products", disable the control. It's looking at the first entry and I can see that result so the formula is satisfied at that point. I need for it to compare both "Paper" AND "Products"

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (8,077)