cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BigE
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
AmirBakht
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (66,569)