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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Collection with LookUp...
Power Apps
Answered

Collection with LookUp with condition comparing nested Record

(0) ShareShare
ReportReport
Posted on by 131

Hi I have an existing Table called "ListItems" which I want to add a "Color" column with RGB info depending if a nested record value ""Phase.Value" matches the "Value" of another table - return column "PhaseColor" (in this case "IndexedPhases").

 

I have tried the following but it does not recognize "Phase.Value" as valid. Does it not reference the "Collect" source (ListItems) for this value similar to how ForAll function works?

 

Collect(ListItems, {Color : LookUp(IndexedPhases,Phase.Value=Value, PhaseColor)});

 

 

ListItems table below with Phase column.

simondpalmer_0-1607922647967.png

ListItems.Phase record below

simondpalmer_1-1607922725240.png

IndexedPhases Table to compare with below

simondpalmer_2-1607922836472.png

Any help would be appreciated!

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    Hi @simondpalmer ,

    Firstly, the names Value and Color are not good titles for fields as they are Reserved Words in PowerApps and this could cause further ambiguity issues, however as the Items of a gallery the below should be the structure you need to add the column

    AddColumns(
     ListItems
     "Color", 
     LookUp(
     IndexedPhases,
     Value=Phase.Value
     ).PhaseColor
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • simondpalmer Profile Picture
    131 on at

    Thank you @WarrenBelz for the answer and advice but how would I add the column to the existing table (ListItems) instead of adding a column to a Gallery Items? I tried to "Collect" it first but it seems it doesn't recognize the Phase.Value. Do I need to specify the "First" value of Phase.Value as it iterates over the ListItems? There is always only one value in Phase.Value FYI

  • Verified answer
    WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    @simondpalmer ,

    I used Phase.Value from the screenshot you supplied. You cannot add columns to a SharePoint table in Power Apps, but a Collection would look something like this

    Clear(MyCol);
    ForAll,
     ListItems,
     Collect(
     MyCol, 
     AddColumns(
     ListItems
     "Color", 
     LookUp(
     IndexedPhases,
     Value=Phase.Value
     ).PhaseColor
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    Hi @simondpalmer ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • simondpalmer Profile Picture
    131 on at

    Thank you @WarrenBelz that worked

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard