cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johnjohn123
Super User
Super User

Get all the Items for SharePoint which ID is inside a collection, without delegation warning

i have 2 SharePoint lists:-

 

1) Task list .. with these fields:-

- ID

- Title

2) PeopleWork list.. with these fields:-

- ID

- TaskID

- Single selection people/group field named People

 

 

So now i tried to create a demo gallery which should only show the Tasks where the user is assigned to. so on the Screen OnVisible i build this collection to get the PeopleWork items which have the login user email:-

 

ClearCollect(relatedtasks,Filter(PeopleWork,People.Email=User().Email))

 

 

then on the Items property of the gallery i define this formula:-

johnjohn123_0-1650109135047.png

 

but i also got a delegation warning..is there a way to fix this?

 

Thanks

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
johnjohn123
Super User
Super User

@v-qiaqi-msft  then what about looping through the collection and issue separate lookups(), as follow:-

 

 

 

i tried it and it worked,, also i did not get any delegation warning..

 

 

ClearCollect(relatedtasks,Filter(PeopleWork,People.Email=User().Email));

Clear(colUserTasks);
ForAll(
   relatedtasks,
   If(
      !IsEmpty(
         LookUp(
            task,
            ID = TaskID
         )
      ),
      Collect(
         colUserTasks,
         LookUp(
            task,
            ID = TaskID
         )
      )
   )
)

 

 

View solution in original post

8 REPLIES 8
v-qiaqi-msft
Community Support
Community Support

Hi @johnjohn123,

If you want to overcome the in operator within the Filter() function, I am afraid there is no way to achieve this in Power Apps.

Best Regards,
Qi
johnjohn123
Super User
Super User

@v-qiaqi-msft that looks weird to me.. i am asking a very basic functionality,,, isn't it? so are their any workarounds to this?

It's a feature currently in preview for Dataverse for Teams.

johnjohn123
Super User
Super User

@jaeiow which feature you are talking about? and i am not using Dataverse, i am using SharePoint !!

Hi @johnjohn123,

No, this is not a basic feature.

Currently, the 'in' operator is not delegated in SP connector, please check the following article for more details:

https://docs.microsoft.com/en-us/connectors/sharepointonline/#power-apps-delegable-functions-and-ope...

 

The Delegation warning issue is not an error, it just means that you could not delegate the Data process from your app to your data source itself. Instead, you could only process data locally. And you could only process 2000 records locally at most.

 

If you want to remove the Delegation warning prompt, and the amount of your SP List is not more than 2000, I think the collection could achieve your needs. Please try the following workaround:

Set the OnSelect property of the OnStart property to following:

ClearCollect(colarran,task)

then modify your formula as below:

Filter(colarran, ID in relatedtasks.TaskID)

 

Best Regards,
Qi
johnjohn123
Super User
Super User

@v-qiaqi-msft my list contain 200K ++ items.. so your approach will not work

Hi @johnjohn123,

If the amount of your SP List records is more than 2000, I think there is no direct way to achieve your needs in PowerApps.

As a possible solution, you could consider fire a flow from your canvas app, and then retrieve records from your SP list using the flow, then return the retrieved records back to your canvas app, and save it into a collection. After that, you could apply above Filter formula to collection.

Please check and see if the following thread solution or video resource could achieve your needs:

https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-get-combobox-to-show-all-the-results-...

https://www.youtube.com/watch?v=2M0zCyu__20

Best Regards,
Qi
johnjohn123
Super User
Super User

@v-qiaqi-msft  then what about looping through the collection and issue separate lookups(), as follow:-

 

 

 

i tried it and it worked,, also i did not get any delegation warning..

 

 

ClearCollect(relatedtasks,Filter(PeopleWork,People.Email=User().Email));

Clear(colUserTasks);
ForAll(
   relatedtasks,
   If(
      !IsEmpty(
         LookUp(
            task,
            ID = TaskID
         )
      ),
      Collect(
         colUserTasks,
         LookUp(
            task,
            ID = TaskID
         )
      )
   )
)

 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,621)