Skip to main content
Community site session details

Community site session details

Session Id : maceggMXXaUtWp7heskHZL
Power Apps - Building Power Apps
Answered

Search in nested table

Like (0) ShareShare
ReportReport
Posted on 16 Mar 2022 11:14:20 by 482

Dear community

 

In my table "integration" there is a nested table (not record!) called "managersNested". In my gallery, I have added the following as for the Items property:

 

SortByColumns(
 Filter(
 AddColumns(
 integration,
 "managersNested",
 Filter(
 managers,
 Title = integration[@Title],
 (role = "390" || role = "420" || role = "932")
 )
 ),
 StartsWith(Title, textinput.Text) || 
 StartsWith(Street, textinput.Text) || 
 StartsWith(Zip, textinput.Text) || 
 StartsWith(Place, textinput.Text) 
 ),
 "Title"
)

 

 

I would now like to also be able to return entries in mentioned gallery above ("integration" data source) when searching for managersNested.UserId and was wondering how you would approach this?

 

Simply adding another "StartsWith(managersNested.UserId, trextinput.Text)" doesn't work, unfortunately 😞

 

Thanks in advance

Categories:
  • mrQ Profile Picture
    482 on 22 Mar 2022 at 10:02:40
    Re: Search in nested table

    Hi @v-jefferni 

     

    I understand.

    Thank you so much for your help!

  • v-jefferni Profile Picture
    on 22 Mar 2022 at 09:41:46
    Re: Search in nested table

    Hi @mrQ ,

     

    With search text in Text Input, the answer is no. I would recommend you to use a Combo box which contains all user/manager emails to select from and filter the collection on the selected user email. I know this complicates the search functionality, but it's the only way to go if you don't want an exact match search in nested tables.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

     

     

  • mrQ Profile Picture
    482 on 22 Mar 2022 at 09:09:54
    Re: Search in nested table

    hi @v-jefferni 

     

    That looks already much better and it seems to work, thank you! However, it is only searching for exact matches at the moment. E.g. if I only type in half of the email, it wouldn't return any results.

     

    Is there a fix for this?

     

    I also realized I can get rid of the second AddColumns now.

  • Verified answer
    v-jefferni Profile Picture
    on 22 Mar 2022 at 08:58:49
    Re: Search in nested table

    Hi @mrQ ,

     

    Sorry, I got the issue after reviewing the clearcollect. Please try below:

    Filter(colTest,
     StartsWith(Title, TextInput1.Text) ||
     TextInput1.Text in UserEmail.'User mail'
    )

     

    The restriction is search text need to be full-match with the User mail then will return the correct records.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • mrQ Profile Picture
    482 on 22 Mar 2022 at 08:13:30
    Re: Search in nested table

    Hi @v-jefferni 

     

    same problem:

    mrQ_0-1647936758698.png

     

  • v-jefferni Profile Picture
    on 22 Mar 2022 at 01:50:50
    Re: Search in nested table

    Hi @mrQ ,

     

    UserEmail is the column added by AddColumns function and in StartsWith you will need this column only, 'User mail' has already been replaced. So use the formula I posted in the last reply is enough, no need to change it.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • mrQ Profile Picture
    482 on 21 Mar 2022 at 15:05:06
    Re: Search in nested table

    Hi @v-jefferni 

     

    Thanks for your response.

    I've sent screenshots because of your request 😊.


    @v-jefferni wrote:

    Please post the error message along with the formulas within your formula bar as the screenshot so that I could figure out which StartsWith is not correct.


    the "managersNested" is the same as the additional "AddColumns" that you have suggested, except that this table includes also other data. From a filtering perspective this shouldn't make a difference.

     

    As even after changing "managersNested" with "UserEmail" I get the same error message.

    Filter(
     colTest,
     StartsWith(Title, TextInput1.Text) ||
     StartsWith(UserEmail.'User mail', TextInput1.Text)
    )

    mrQ_0-1647874953114.png

     

    I think it is because the nested table is not a record, but a table. Though I do not know how to get it to work with a nested table.

     

    Kind regards,

     

  • v-jefferni Profile Picture
    on 21 Mar 2022 at 07:58:25
    Re: Search in nested table

    Hi @mrQ ,

     

    For later threads you'd better post all the related formulas in text so others will be able to modify on it easily. The filter function on your end will be:

    Filter(colTest,
     StartsWith(Title, TextInput1.Text) ||
     StartsWith(UserEmail, TextInput1.Text)
    )

     

    You have named the column "UserEmail" when you created the collection using the AddColumns function.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • mrQ Profile Picture
    482 on 21 Mar 2022 at 07:38:42
    Re: Search in nested table

    Hi @v-jefferni 

     

    The error appears for the StartsWith with the UserId. 

    I saved everything into a collection to make sure its not related to my data source:

    ClearCollect(
     colTest,
     SortByColumns(
     AddColumns(
     AddColumns(
     integration,
     "managersNested",
     Filter(
     managers,
     Title = integration[@Title],
     (role = "390" || role = "420" || role = "932")
     )
     ),
     "UserEmail",
     ThisRecord.managersNested.'User mail'
     ),
     "Title"
     )
    )

     

    Then I filter the collection with StartsWith:

    mrQ_0-1647848059841.png

    When hovering over the managersNested.'User mail' I see the this error message:

    mrQ_1-1647848169049.png

     

    Kind regards,

  • v-jefferni Profile Picture
    on 21 Mar 2022 at 01:56:08
    Re: Search in nested table

    Hi @mrQ ,

     

    Please post the error message along with the formulas within your formula bar as the screenshot so that I could figure out which StartsWith is not correct.

     

    I found a typo within my last post reply, but it should not cause this kind of error.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete