cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

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
Highlighted
Community Support
Community Support

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
Highlighted
Resolver I
Resolver I

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

Highlighted
Helper III
Helper III

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. 

Highlighted
Community Support
Community Support

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

Highlighted
Helper III
Helper III

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (7,532)