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 / 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
    155,632 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
    155,632 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
    155,632 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 414

#2
WarrenBelz Profile Picture

WarrenBelz 377 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard