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

two deep lookups

I have three entities; reader, hospital, and tray. I have linked the hospital entity to the reader and the reader to tray. The location of the reader contains the location. When the reader reads a tray I know where the tray is because the reader is in a fixed location.

 

How do I populate the location of the tray based on the reader that reads it. Does this require two lookups? look up the reader Id from the tray and compare it to reader ID on the reader then lookup the hospitalname on the reader?

2 REPLIES 2
rdevine
Frequent Visitor

Here is a little more deteal on my scenario.

 

I have an entity called 'Hospital'. This contains a picklist of hospital locations.

I have an entity called 'Reader'. This contains a relationsional lookup of the hospital names.

I have an entity called 'Tray'. This contains a relationsional lookup of the reader names.

 

I want to display a trays location within the hospital. For this I need to look up the reader then lookup the hospital based on the reader.

 

How do I accomplish this?

Hi rdevine,

 

According to your description, I created three custom entities in CDS, Hospital, Reader, and Tray.


There is a picklist column “HospitalLocation” in the entity Hospital. Tray looks up to Reader, Reader looks up to Hospital.
Then create connections from PowerApps to the three entities.


On the app, add a Dropdown control, set its Items property as: Tray.TrayName.


Then add a label, set its Text property as

LookUp(Hospital,PrimaryId=LookUp(Reader,PrimaryId=LookUp(Tray,TrayName=Dropdown1.Selected.TrayName,Reader_.PrimaryId),Hospital_.PrimaryId),HospitalLocation)

 

This function will return the location within the hospital according to the TrayName selected in the dropdown control.


Hope this could be your reference.


Best regards,
Mabel Mao

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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 Solution Authors
Top Kudoed Authors
Users online (47,294)