Hi,
I'm trying to solve a delegation warning from the following piece of code:
Filter(partnumbers, ID in [1, 2, 3])
Where partnumbers is a list that contains a column called 'ID'. I would like to return the rows that contain either an ID of 1, 2 or 3. However, I get a delegation warning about the 'in' statement. What is the reason why it throws a delegation warning.
Thanks in advance!
Not quite. For example is instead 1-100. It could be that some numbers is missing so the ID>=1 And ID<=100, would not solve this problem. Let say I have a list [1,3,8,10]. I could use ID=1 Or ID=3 Or ID=8 Or=10. But of course when the last is larger, this is not sufficient. Is there anyone out there, that knows a more elegant way to bypass this problem?
@mdevaney please correct if i'm wrong, the documentation says:
I never test it, just believe it. 🙂
@tommyvtran1
If you want the numbers 1-to-100 to appear you should not use the IN operator. Do this instead:
Filter(partnumbers, ID>=1 And ID<=100)
No, there is not any other option if you must use 'IN' instead. I am telling you the simplest way. The 'IN' operator can only be delegated in SQL and CDS, not SharePoint. You may read further info here:
https://docs.microsoft.com/en-us/connectors/sharepointonline/
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Is there another option? For example if I have a list with number 1 - 100. Using only 'OR' statements in not practical and inefficient.
Filter(partnumbers, ID=1 Or ID=2 Or ID=3 ... Or ID=100)
@tommyvtran1
To successfully avoid delegation you will need to use the OR operator like this.
Filter(partnumbers, ID=1 Or ID=2 Or ID=3)
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
At least thanks for letting me know that it is not delegable to SharePoint. For now I gave only a small example to compare with [1, 2, 3]. But how to deal with a large list, as "Filter(partnumbers, ID =1 || ID=2 || ID=3)" is not really practical
Hi @tommyvtran1 ,
Unfortunately, "in" operator is not delegable to SharePoint.
To solve your example:
Filter(partnumbers, ID =1 || ID=2 || ID=3)
but i'm sure that is not you are looking for.
WarrenBelz
146,751
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional