0

I have 2 SharePoint lists:-

  1. Task list .. with these fields:-
  • ID

  • Title

  1. PeopleWork list.. with these fields:-
  • ID

  • TaskID .. This should store the Task ID from the Task list in numeric format

  • Single selection people/group field named People

So now i tried to create a demo gallery inside my Power Apps canvas 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:-

enter image description here

but i also got a delegation warning..is there a way to fix this? Can i instead of eager loading the Tasks items using this formula:-

filter(task,ID in relatedtasks.TaskID)

which will retrieve the related Tasks items in one call, to Loop through the relatedtasks collection and for each TaskID issue a separate Lookup to get the related Task and build a collection of all the Tasks which have their Ids inside the relatedtaks.TaskID collection? so i can get all the related Tasks item without getting an delegation warning?

Thanks

horseyride
  • 17,007
  • 2
  • 11
  • 22
John John
  • 1
  • 72
  • 238
  • 501

1 Answers1

1

Don’t collect the records, PowerApps can display all records, just not collect them.

You can use

Filter( PeopleWork, User().Email = useremailcolumn)

On your gallery, you can add a textfield of value:

First( Filter( Task, Id = ThisItem.TaskId)).Title

Now you have all records related to the logged in user and the task names ;-)

Iona Varga
  • 509
  • 2
  • 8
  • so where i need to do this filter `Filter( PeopleWork, User().Email = useremailcolumn)`? and how i will connect it to the gallery? – John John Apr 21 '22 at 15:33
  • 1
    Your main gallery items field. This way all tasks in the gallery are userbased. – Iona Varga Apr 22 '22 at 05:09
  • ok i tried your approach.... but doing separate calls to get the Task Name.. caused a serious performance issues.. one of the end users how scroll over the 9,000 item inside the gallery got an error and was not able to view any data inside the gallery later on.. i posted my problem inside the Power Apps forums @ https://powerusers.microsoft.com/t5/Building-Power-Apps/An-End-user-got-this-error-while-scrolling-through-a-Gallery/m-p/1554974#M400289 .. things are getting crazy t my end! – John John Apr 22 '22 at 13:18
  • 1
    9000 tasks to one user sounds like the process has a problem. Why should he/she have 9000 tasks assigned? I guess your model needs tweaking. Anyway, you can always use addColums to add the task name to the user list. That can increase speed with these amount of tasks – Iona Varga Apr 22 '22 at 18:25
  • this can be the case after 2-3 years,, i am stress testing the system at this stage – John John Apr 22 '22 at 18:31
  • It’s getting to a point where powerapps and share point are telling you it’s too much. Especially the combination since share point is not a database ;-) – Iona Varga Apr 22 '22 at 18:36
  • 1
    Just don’t use sharepoint – Iona Varga Apr 24 '22 at 06:00
  • so you think the problem is with SharePoint as a backend rather than been in Power Apps,, so if i change the backend to be SQL Server and still use Power Apps i should be in a better situation ? – John John Apr 24 '22 at 23:42