web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Search in nested table
Power Apps
Answered

Search in nested table

(0) ShareShare
ReportReport
Posted on 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:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @mrQ ,

     

    You can add another AddColumns function out of the one you have already:

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

     

    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 at

    Hi @v-jefferni 

     

    Thanks for your response.

    Unfortunately, this doesn't work as I get the following error message:

    mrQ_0-1647621141230.png

     

    Do you know how to work around this issue?

  • v-jefferni Profile Picture
    Microsoft Employee on at

    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.

  • mrQ Profile Picture
    482 on at

    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
    Microsoft Employee on at

    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 at

    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
    Microsoft Employee on at

    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 at

    Hi @v-jefferni 

     

    same problem:

    mrQ_0-1647936758698.png

     

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    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 at

    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.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard