cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
gmaasz
Level: Powered On

Search for text in a table containing records in each row

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Search for text in a table containing records in each row

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:4.JPG

The App's configuration as below:5.JPG

 

6.JPG

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
xyzzyx666
Level 8

Re: Search for text in a table containing records in each row

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:

country_currentuser1.png

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.

country_currentuser2.png

gmaasz
Level: Powered On

Re: Search for text in a table containing records in each row

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. 

Community Support Team
Community Support Team

Re: Search for text in a table containing records in each row

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:4.JPG

The App's configuration as below:5.JPG

 

6.JPG

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

gmaasz
Level: Powered On

Re: Search for text in a table containing records in each row

I really appreciate the solution and effort that went in. Imressed with community response. Thanks

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,958)