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 / ClearCollect; AddColum...
Power Apps
Answered

ClearCollect; AddColumn with Lookup retrieves the same value for all rows

(0) ShareShare
ReportReport
Posted on by 23

Hi there,

 

I have 2 custom data entities in Dynamics Fin&Ops where entity A has ID(1) and Description columns and entity B has its own ID(2) and the ID(1) from the entity A columns. I am trying the following to create my own collection which consists of ID(2), ID(1) (basically entity B) but also looked-up Description from entity A associated with the corresponding ID(1).

 

ClearCollect(MyCollection, AddColumns(entity B, "MyDescription", LookUp(entity A, 'ID(1)' = 'ID(1)').Description));

 

I am getting the collection created with the added "MyDescription" column, but each row has the same Description retrieved although each ID(1) has a different Description. I suspected it was because the columns are called the same ('ID(1)') and the logic gets confused - this is when I experimented with AddColumns and RenameColumns to get the lookup to search against a column with different name but with the same content - the same result. I've also tried to collect the data from data entities and use those collections in my formula but again, same result. I may end up changing the data entity B itself to have the description already part of it but I feel I'm so close!

 

Thank you for any advice.

Categories:
I have the same question (0)
  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hi!

     

    You will need to use the disambiguation operator DataSource[@columnname] as this will distinguish between your two data sources, because you are correct in that it is only reading that ID(1) from the one data source! 😺

     

    Details on disambiguation can be found here,

     

    Cheers,

    ManCat

  • Hosto Profile Picture
    23 on at

    Thanks ManCat - this worked!

     

    For anybody who would find this helpful, I inserted the function like this:

     

    ClearCollect(MyCollection, AddColumns(entity B, "MyDescription", LookUp(entity A, 'ID(1)' = entity B[@'ID(1)']).Description));

     

    Awesome!

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    You're welcome! Glad I was able to help you resolve your issue 😺

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 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard