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

Return Other Column Values from Lookup

I am trying to replicate part of the lookup column functionality from SharePoint Lists in Dataverse, and I could use some suggestions...

 

In SharePoint, you can create a lookup column that references another list. When you do that, you can also return other columns from that lookup list. 

 

I'm looking to replicate that end result in Power Apps using Dataverse.

 

Here is a specific example:

 

  • I have a table that contains the following columns:
Product Group NameProduct Group Leader NameProduct Group Leader EmailProduct Group Description
TextTextTextText

 

  • I have a second table that has the following columns
Product NameProduct Group NameProduct Group Leader NameProduct Group Email
TextLookupTextText

 

What I would like to have happen is for the Product Group Leader Name and Product Group Leader Email fields of the second table to auto-populate based on the selection from the Product Group Name Lookup.

 

These tables currently have a Many -> One Relationship (Second Table to First). I cannot figure out how to reference the data from the first table into the second based on what is selected.

 

Does anyone have any thoughts on this?

1 ACCEPTED SOLUTION

Accepted Solutions

@mikebrodt 

 

If you have a lookup, then in canvas app datacard will be a combo box.

 

onchange property of combobox : UpdateContext({AnyVariableName: LookUp('Test 1S', 'Test 1' = DataCardValue8.Selected.'Test 1')})

 

To get variable for other fields, use AnyVariableName.field1 and AnyVariableName.field2.

 

Test 1S is the parent record which present as lookup in child entity. Test 1 is the unique identifier which you get from selected value of the combobox.

 

If it answers your question, kindly give kudo and accept as solution.

 

 

Regards,

Prakash

 

 

View solution in original post

5 REPLIES 5
Prakash4691
Solution Specialist
Solution Specialist

@mikebrodt ,

 

Is it on model driven app or canvas app?

 

When those values needs to be populated after save or on change of the field on-demand?

 

If you want to populate after save you can use powerautomate automatic flow. Trigger when record gets created/modified. Attached screenshot for your reference. Test 2S has lookup of Test 1S, populating name of test 2 from test 1. That works for both model driven app and canvas app.

Prakash4691_0-1631233033270.png

 

If you want on-demand, then in model driven app you can achieve using javascript. In canvas app, you have to write formula on onchange of the field, use lookup function to retrieve a record save it in a variable either it can be global or a context. Populate default property of the text box from the variable. Ex: variable.field1 etc..

 

If it answers your question, kindly give kudo and accept as solution.

 

 

Regards,

Prakash

@Prakash4691 Thank you so much for you reply.

 

I am working on a Canvas app. Is there any way to reference the record of selected item in the 'Product Group Name' field to get it's data in another field? If not, how do I do a lookup against the selected record? 

@mikebrodt 

 

If you have a lookup, then in canvas app datacard will be a combo box.

 

onchange property of combobox : UpdateContext({AnyVariableName: LookUp('Test 1S', 'Test 1' = DataCardValue8.Selected.'Test 1')})

 

To get variable for other fields, use AnyVariableName.field1 and AnyVariableName.field2.

 

Test 1S is the parent record which present as lookup in child entity. Test 1 is the unique identifier which you get from selected value of the combobox.

 

If it answers your question, kindly give kudo and accept as solution.

 

 

Regards,

Prakash

 

 

View solution in original post

mikebrodt
Frequent Visitor

@Prakash4691 Thank you so much for your help! That answered my question, but it left me with one challenge... the box I am working with isn't a combo box; it is a field in a form. The formula you provided works, the only issue is that it is returning a record, not text. Is there a way to get what is returned transformed into text?

mikebrodt
Frequent Visitor

Actually, I figured it out. Thank you for all your help!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,753)