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 / Collect data into a si...
Power Apps
Unanswered

Collect data into a single collection from two entities in CDS

(0) ShareShare
ReportReport
Posted on by 220

Hello Experts ,  Can someone help me to collect data from two Entities. I am struggling to write formula for that.  ? 

 

the entity names are worker and worker fixed compensation ... I am not sure what else information should i provide . please let me know if more information is required.. thanks

Categories:
I have the same question (0)
  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    Can you be more specific ? Are you trying to gather all data from worker fixed compensation entity or only a specific number of columns ? The relationship between the entities is one to one ?

     

    Try this one, to add only one column:

    ClearCollect(Result, AddColumns(worker,"AddedColumnName",LookUp(worker fixed compensation, ID=worker fixed compensation[@ID]).ColumnToBeImported))

     

    If your database is a large one, you'll have to wait a while. So I'll recomand to Filter the data from the two entities with the ones you are really interested in and after that to do this operation locally. 

  • P_SA Profile Picture
    220 on at

     I have two entities.

     Entity 1 : Worker
     Entity 2 : Worker fixed compensation 

     

     In Entity 1 , there is a field named " Full Name "  . I have a gallery connected to Entity 2 .. 
     there is a common field in both entities called " worker " . In entity 1 it is a unique identifier and in entity 2 it is a lookup value.... 

     I want display the full name in the gallery by doing a lookup on the entities.. How do i solve this ?

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    Put in Items gallery  property the following:

    AddColumns(Entity 2,"Full Name",LookUp(Entity 1, worker=Entity 2[@worker]).Full Name)

     

    and then inside gallery insert a label with the Text property ThisItem.Full Name

  • P_SA Profile Picture
    220 on at

    getting this errorUntitled.png

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    The 'worker' inside the brackets has to have the first letter capitalised ( this is in entity right ? 'Worker') 

  • P_SA Profile Picture
    220 on at

    Yes Worker is there in both entities...   I changed it capitalized... still i face the same error. 

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    Last try from my side: 😊

    1. You have too many closing brackets (it's one, not two at the end) .

    2.  Change inside the  lookup:

          'Worker Fixed Compensation'[@Worker] with Workers[@Worker]

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    @P_SA,

     

    Please try this:

     

    AddColumns('Worker fixed compensation ',"FullName",Worker.'Full Name')

     

    The database relationship call of CDS is very convenient, just use <LookUp field>.<RelatedEntityField> to call any fields in related entity.
    Sik

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 305 Most Valuable Professional

#2
11manish Profile Picture

11manish 212

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard