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

Display in a gallery 1:N relationship

Hello,

I created 2 tables: 1 named Rig and 1 named Pits, each rig can have many pits, so I set up a 1:N relationship between the tables, that recalls Rig as lookup.

I have in my app 2 galleries in 2 different screens, the first one lists all Rigs, from which the user needs to do a selection, and the second one recalls all the Pits for that selection. My problem is that in the second gallery I can display all the columns that I want from the Pit table, BUT NOT the Rig name (the one with lookup). Why is that? If I go in the data I can see it... How can I see this data in the Pit gallery?

 

Also I want to be able to add entries in the Pit gallery that will go under the currently selected Rig, but I don't figure out how to make the app fill in the Rig column. I tried with Patch functions, which creates a new entry ok, but with the Rig field empty. 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @mangiafrutta ,

 

Could you please share more details about your scenario? How were you adding entries in the Pit gallery?

 

Since you are working with entities(tables of CDS or Dataverse),  I made a test on my side:

lookupfield.gif

The Label in Gallery2 is set to ThisItem.LookUpField.Entity1Field in Text property.

The Combo box in Gallery2 is set to ThisItem.LookUpField in its DefaultSelectedItems property, and Choices([@Entity2].LookUpField) in its Items property.

Combo box in the New Form was set to Entity1Gallery.Selected in DefaultSeletctedItems and the same as the former combo box in Items property.

 

If you have further questions, please feel free to let us know. And screenshots of your interface would be very helpful.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

3 REPLIES 3
v-jefferni
Community Support
Community Support

Hi @mangiafrutta ,

 

Could you please share more details about your scenario? How were you adding entries in the Pit gallery?

 

Since you are working with entities(tables of CDS or Dataverse),  I made a test on my side:

lookupfield.gif

The Label in Gallery2 is set to ThisItem.LookUpField.Entity1Field in Text property.

The Combo box in Gallery2 is set to ThisItem.LookUpField in its DefaultSelectedItems property, and Choices([@Entity2].LookUpField) in its Items property.

Combo box in the New Form was set to Entity1Gallery.Selected in DefaultSeletctedItems and the same as the former combo box in Items property.

 

If you have further questions, please feel free to let us know. And screenshots of your interface would be very helpful.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

mangiafrutta
Frequent Visitor

Thank you @v-jefferni 

I followed your steps and managed to do it. 

I was not using a combo box, inserted that one also.

 

Cheers,

mangiafrutta

mangiafrutta
Frequent Visitor

Thank you @v-jefferni 

I followed your steps and managed to do it. 

I was not using a combo box, inserted that one also.

Cheers,

mangiafrutta

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (2,909)