cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mattybear
Frequent Visitor

CDS PowerApp - Showing Field from Related Entity

I have a simple setup in the CDS.

Equipment has a 1:N relationship with Repair.

Equipment can have many Repairs.  Repair must have Equipment.

 

I want to show a list of Repairs within a PowerApp gallery list and then allow the user to click into for more information (such as description, progress, etc).

 

I'm struggling with something that should be simple - In the list of Repairs, showing the Name of the Equipment (referred to as Fleet Number in my example).

 

The first likely thing to do would be to follow the syntax helper toward this:

 

 

ThisItem.Equipment.'Fleet Number'

 

 

 

Other examples in this forum where people seem to have a 50% chance of success also failed.  This includes the First(Filter()) method and LookUp method.  The syntax gets to a point where it is accepted, however, no data is appearing.

 

 

First(Filter([@Equipment], Equipment = ThisItem.Equipment.Equipment)).'Fleet Number'

 

 

 

I know that I can access that Equipment entity because when I put a label on the form with the following, "AA100" appears which is the Fleet Number of the first record in Equipment

 

 

First(Equipment).'Fleet Number'

 

 

 

Any help would be appreciated - losing faith in CDS PowerApps very quickly after being blocked on something that should be VERY simple.

1 REPLY 1
v-siky-msft
Community Support
Community Support

Hi @mattybear,

 

Have your ever bound the equipment records to Repair entity?

The formula you used is right. The cause of this issue seems to be that no record is assigned to the lookup field "equipment". You can go to PowerApps web- Data - Entity -Data, and check if there is any data in the equipment field.

If no data, you can use EditForm to submit it. Beside that, Patch function and Relate function can all do it.

Patch(Repair,First(Repair),{Equipment:<the record of Equipment entity>})
Relate( First( Equipment ).Repair, First( Repair ) )

For more reference, please refer to these docs: Relate function ,Patch function .

Best regards,

Sik

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Kudoed Authors
Users online (91,109)