I have a sharepoint list with a multiple select people picker field for users from different countries. In my app I want to check if the current user's name features in any of the records. I don't want to use the country to get the correct row and filter only one record, I wwant to run through all the table entries until it finds the name of the current user within one of the records.
I've tried everything I could find. Any help will be kindly appreciated.
Solved! Go to Solution.
Hi @gmaasz,
Do you want to check if the current user's name is existed within the Person field (Multiple selection) of all records of your SP list?
Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:
The Data structure as below:
The App's configuration as below:
Add a "Search" button within the screen of my app, set the OnSelect property to following:
Clear(ResultCollection); ForAll( RenameColumns('20190104_case6',"ID","ID1"), If( User().Email in Executor.Email, /* <- Executor is a Person column in my SP list, which enables "Allow multiple selections" option*/ Collect(ResultCollection, LookUp('20190104_case6', ID=ID1)) ) )
On your side, you should type:
Clear(ResultCollection); ForAll( RenameColumns('YourSPList',"ID","ID1"), If( User().Email in YourPersonColumn.Email, Collect(ResultCollection, LookUp('YourSPList', ID = ID1)) ) )
Or
Clear(ResultCollection); ForAll( RenameColumns('YourSPList',"ID","ID1"), If( User().FullName in YourPersonColumn.DisplayName, Collect(ResultCollection, LookUp('YourSPList', ID = ID1)) ) )
Add a Data Table control within the screen, set the Items property to following:
ResultCollection
Note: If the current user existed within the Person column of any record of your SP list, when you click "Search" button, it would display corresponding record within the Data Table.
Please check the attached GIF screenshot for more details:
Best regards,
Kris
Hi @gmaasz,
Do you want the gallery show all the list's items?
And then also filter the current user?
I make a test as next, and the SP list is as the screenshot:
And then I make one Gallery and set its TemplateFill:If(User().FullName=User,Blue)
it will show all the list's items and the current user maybe marked as different color.
No I dont want to use a gallery, I want to perform an action on click of a button, if the condition as met that the current user's name is found within the sharepoint list. I get it right when there is only one person per row, but I have multiple people in the same column of a row, making the value a record to evaluate.
Hi @gmaasz,
Do you want to check if the current user's name is existed within the Person field (Multiple selection) of all records of your SP list?
Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:
The Data structure as below:
The App's configuration as below:
Add a "Search" button within the screen of my app, set the OnSelect property to following:
Clear(ResultCollection); ForAll( RenameColumns('20190104_case6',"ID","ID1"), If( User().Email in Executor.Email, /* <- Executor is a Person column in my SP list, which enables "Allow multiple selections" option*/ Collect(ResultCollection, LookUp('20190104_case6', ID=ID1)) ) )
On your side, you should type:
Clear(ResultCollection); ForAll( RenameColumns('YourSPList',"ID","ID1"), If( User().Email in YourPersonColumn.Email, Collect(ResultCollection, LookUp('YourSPList', ID = ID1)) ) )
Or
Clear(ResultCollection); ForAll( RenameColumns('YourSPList',"ID","ID1"), If( User().FullName in YourPersonColumn.DisplayName, Collect(ResultCollection, LookUp('YourSPList', ID = ID1)) ) )
Add a Data Table control within the screen, set the Items property to following:
ResultCollection
Note: If the current user existed within the Person column of any record of your SP list, when you click "Search" button, it would display corresponding record within the Data Table.
Please check the attached GIF screenshot for more details:
Best regards,
Kris
I really appreciate the solution and effort that went in. Imressed with community response. Thanks
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
197 | |
67 | |
46 | |
41 | |
28 |
User | Count |
---|---|
256 | |
121 | |
84 | |
80 | |
77 |