cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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.
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.
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
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 390 members 4,794 guests
Please welcome our newest community members: