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

Create Entity with Values Populated from Lookup

Hi,

 

Been struggling with this scenario for a couple of days now:

 

  1. I have an entity called "Factor" that has a field called "Value" in addition to other fields such as Name, Min Value, etc.
  2. I have another entity called "Quote" that has a lookup field to Factor.
  3. Upon creating a Quote the lookup field lists the names of the Factors.  
  4. On the Quote create form, upon selecting a Factor, I would like to set Quote field values to the associated Value, Min Value, etc., fields of the selected Factor.

Is it possible to achieve this behavior in a model-driven app?  I'm a noob to Power Apps and am not seeing where one could lookup an entity and use its field values when creating another separate entity.  At least not through the Business Rules editor.  Perhaps this is a situation where utilizing Xrm.WebApi.retrieveRecord would be necessary in a client script file?

 

Thanks in advance for any help.

 

Thanks,

Dan

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @djallen ,

Do you want to set a field's default value from another entity data in model-driven form?

I'm afraid it's not supported yet in model driven app.

However, you could do this in canvas app.

As an alternative way, I suggest you embedded a canvas app in your model driven app.

Here's a doc about it for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/model-driven-apps/embedded-canvas-app-add-classic-d...

In canvas app, you firstly, you need to connect with the current entity and the related entity (Factor and Quote)

Then insert a form, set its data source to Quote.

By default, a combo box will be used to choose value for the lookup field.

So you could set Quote field textinput's Default:   (clean the lookup field datacard's Default)

lookup combo box.Selected.Value

Or 

lookup combo box.Selected.Min Value

Then the Quote field will change with the selection of the lookup field.

 

 

Best regards,

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

View solution in original post

1 REPLY 1
Community Support
Community Support

Hi @djallen ,

Do you want to set a field's default value from another entity data in model-driven form?

I'm afraid it's not supported yet in model driven app.

However, you could do this in canvas app.

As an alternative way, I suggest you embedded a canvas app in your model driven app.

Here's a doc about it for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/model-driven-apps/embedded-canvas-app-add-classic-d...

In canvas app, you firstly, you need to connect with the current entity and the related entity (Factor and Quote)

Then insert a form, set its data source to Quote.

By default, a combo box will be used to choose value for the lookup field.

So you could set Quote field textinput's Default:   (clean the lookup field datacard's Default)

lookup combo box.Selected.Value

Or 

lookup combo box.Selected.Min Value

Then the Quote field will change with the selection of the lookup field.

 

 

Best regards,

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

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (75,790)