cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Brammers
Advocate I
Advocate I

Custom Fields in the User Entity

Hi, i'm a bit new to CDS, so apologies in advance if this has been asked elsewhere, and I was unable to find it in the search!

 

Basically, I have a selection of custom entities which I use for various custom PowerApps that I have built. These are all working fine, no problems at all.

 

I am currently working on a 'Staff Details' type app, which I have linked to the default 'User' entity in CDS - again - all fine, all working as expected and data can be seen and edited (including a few custom fields I have added to the 'User' entity).

 

Now, what I am having trouble with is linking entities together via a common field / key - i.e - I have a 'Leave Data' entity that tracks staff leave / absences / entitlements, but I would also like to be able to see this data in the 'User' entity - but I don't want to enter it all again, I just want it to look up the values from the 'Leave Data' entity, and have it linked to the User record based on the Primary Email ID.

 

Any advice would be welcome. I've tried creating relationships, but there is no way of specifying a key to base the lookup on?

 

Thank you in advance.

1 REPLY 1
EricRegnier
Super User II
Super User II

Hi @Brammers,

The CDS way to relate entity together is with a lookup type field. When creating a lookup field, in your case, a lookup to User entity on "Leave Data", it creates a 1-N CDS relationship, where the foreign key (GUID) of user is saved on the Leave Data. If you're using model-driven apps you can easily have a subgrid on your form that displays all related leave records. If you're using canvas apps, you can also list the related entities, by filtering the gallery with select User ID (GUID). Have a look at this page for canvas apps: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-references

Hope this helps...

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,510)