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 through nested ...
Power Apps
Answered

Search through nested table for a match

(0) ShareShare
ReportReport
Posted on by 102

Hello,

 

I have a collection with a nested table. The nested table only have one column (Values), but it can contain multiple rows.

 

I want to look up the title of my collection (TestCollection) and then search through the nested table (Templates column) if any of the values in the nested table matches my value. I want it to return true if it finds a match and false if it does not. 

 

RobinHenriksen_0-1697787155853.png

 

Any help is greatly appreciated 🙂

 

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @RobinHenriksen ,

     

    According to your description, you want to add a flag column in your table based on if the nested table contains the current Title .

    Here are the steps you can refer to :
    (1)This is my test data , i create this data by a Button- OnSelect:
    ClearCollect( mytest , { Title: "Power Apps",  Templates : ["Power BI" , "Power Apps" , "Power Automate"] }, { Title: "Power Apps",  Templates : ["Power BI" , "Power Automate"] } ,  { Title: "Power BI",  Templates : [ "Power Apps" , "Power Automate"] } ,{ Title: "Power Automate",  Templates : [ "Power Apps" , "Power Automate"] } )

     

    vxiaochenmsft_0-1697789002457.png

     

    (2)We can use this code to add a flag column like this:
    AddColumns( mytest ,"flag" ,If( LookUp( Templates , Value = Title ).Value =Blank() ,false ,true) )

     

    And the result is as follows:

    vxiaochenmsft_1-1697789002460.png

     

    Best Regards,

    Wearsky

  • RobinHenriksen Profile Picture
    102 on at

    Thank you for the quick reply. 

     

    My description probably wasn't accurate enough.

    "According to your description, you want to add a flag column in your table based on if the nested table contains the current Title ."

     

    I want to find the record based on the title, but want to search through the nested table in that record with a separate value (from a drop-down box). I assume I could just change out title with that value?

     

    AddColumns( mytest ,"flag" ,If( LookUp( Templates , Value = Title ).Value =Blank() ,false ,true) );

     

    I don't necessarily want to add a new column with the values. My plan is to use the return value (true/false) to change checkboxes to true/false. So if it easy to modify the formula to just return true/false without adding a column it would be great, but I guess adding a column is fine as well.

     

    Lastly, I have a problem with AddColumns not working. I noticed it first in my own collection. I even tried to just add "AddColumns(TestCollection,"Hello","Hello"); I also tried with your test code, but the new column does not appear.

    OnSelect on a button (pressed once first)

    RobinHenriksen_0-1697792967243.png

    OnSelect on a second button (pressed after first button is pressed)

    RobinHenriksen_1-1697793010759.png

    Table (I've made sure to refresh variables several times):

    RobinHenriksen_2-1697793023248.png

     

    Again, thank you for your help.

     

  • Verified answer
    RobinHenriksen Profile Picture
    102 on at

    I managed to figure it out 🙂

     

    The code below is used in the "Default" property of the checkbox in my gallery. It shows ThisItem.Include if I don't want to use the template preset. If I decide to use the template preset I change bolUpdateTemplate to true. Then it will autocheck/uncheck the include checkbox according to the role I've chosen in my dropdown box.

     

    If(
     bolUpdateTemplate,
     If(
     LookUp(
     LookUp(
     'Task List Template',
     Title = ThisItem.Title // The title of the current gallery and task template list are identical
     ).Templates,
     Value = '6010Role'.Selected.Value // My dropdown box with Choices()
     ).Value = Blank(),
     false,
     true
     ),
     ThisItem.Include
    )

     

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard