1

We have a list named Task, with these fields:-

  • Title

  • PeopleWork

Where the PeopleWork field is of type People/Group which allow multiple selection, as follow:-

enter image description here

Now inside our Canvas app >> i added a gallery >> and i want the gallery to only show the items where the login user is defined inside the PeopleWork field, as follow:-

enter image description here

the formula worked since i only have few items, but as shown in the picture it is raising a delegation warning. so is there a way to fix this formula to remove the delegation warning ? i am open to any option even changing the SharePoint Fields' types or even redesign the whole list.

Thanks

2 Answers 2

0

The workaround for this issue is to use the Flexible height gallery, group the elements we are adding in the gallery and set the visible property using the same formula you have used.

First, on your app start, save the email id of the current user in a variable.

Set(varCurrentUserEmail,User().Email);

We can use varCurrentUserEmail while applying the below formula.

varCurrentUserEmail in ThisItem.PeopleWork.Email

At the single item/group level you will not get the delegation warning.

enter image description here

The data source of the gallery will be your List and no filter is applied over there. As we are using the Flexible Height gallery, it will show only those items for which the current user is part of the people work field.

References:

  1. PowerApps Delegation & Gallery Filtering using Person column (single and multi select)
  2. PowerApps Delegation & Gallery Filtering using multi select Choice and Lookup Columns
4
  • so this means i will need to retrieve all the items from the datasource and hide unrelated one.. this sound a vary bad practice..what if we have 20,000 items and we only need to show 5 of them !
    – John John
    Commented Apr 18, 2022 at 14:39
  • As per the mechanism of the Flexible height gallery, it should render only those 5 items. I verified the concept by setting my PowerApps application's data limit to 2. which means my app can load only 2 items but I had 4 items in the list for which my user was in the People Columna and it rendered all the 4 items. Need to give it a try with 20K items because with PowerApps OOTB limit is 2000. Commented Apr 19, 2022 at 6:11
  • even if it works on paper,,, but the idea of loading everything and hide unwanted ones, is horrible to me... in all the cases if you find a video on youtube this does not mean you should follow it 1
    – John John
    Commented Apr 19, 2022 at 15:29
  • 2
    In your question, you have not mentioned that you are working with such a large dataset that can have 20K items. The solution is the correct workaround for the delegation warning. I think you should reconsider your approach with PowerApps if you are working with largedata set becasue even if you are able to filter out the data before loading it in PowerApps, the loading time will kill the performance of the app. Also, kindly add all the details in the question rather then posting it in comment so other people can consider all the scenarios before providing a solution. Commented Apr 20, 2022 at 4:20
0

Well I don't know if you're still looking for the solution but a workaround can be done to achieve without delegation warning.

You can Power Automate Flow on the OnVisible method of the screen and pass EmailID of current user to the flow. Now, In the flow you can use the get items action to get the data and apply the filter on the filter query. It won't give you any problems like delegation. Now, pass the JSON into the PowerApps as string and parse the string in PowerApps to bind it to the gallery. You can check this video from link given below to understand how to send array to PowerApps and parse it.

PowerApps Parsing Array data string from Power Automate

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.