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?
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.
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"
Check out the News & Announcements to learn more.
Did you know that you can visit the Power Query Forum in Power BI and now Power Apps
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.
Check out our new Discover Your Career Path blog post series and get all the details.