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

Embedded canvas app ModelDrivenFormIntegration.Item.[Lookupfield] always returns emtpy

So I am not on a form. just a standard screen, using a timer control...

 

So I have a custom one to many field on the Case entity, called Port.

In the embedded preview version, I can get the guid of selected port using  First([@ModelDrivenFormIntegration].Data).tmit_portName

Now I use

[@ModelDrivenFormIntegration].Item.Port.Port

so Port is the unique identifier on the Port entity.

My app is embedded on the Case entity, the one to many lookup field is called Port on the Case entity.

 

Sadly [@ModelDrivenFormIntegration].Item.Port.Port

or Text([@ModelDrivenFormIntegration].Item.Port.Port) always returns blank

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @Xun ,

Could you please share a bit more ahout the issue that you mentioned?

Are there records existed within your Port entity?

Further, have you faced issue with the formula you provided within your embedded app?

 

Based on the issue that you mentioned, I think there is something wrong with it. Firstly, you have something misunderstanding on the LookUp filed in CDS Entity.

Actually, the LookUp field in CDS Entity is a Many-to-One relationship in CDS rather than One-to-Many relationship. If you custom a LookUp field in your Case Entity, I think the formula you provided is proper. Please make sure the Port field (LookUp field) of the current Case record has been bind to proper Port record.

If the issue still exists, please consider take a try with the following formula:

LookUp(Case, 'Unique Identifier Column' = [@ModelDrivenFormIntegration].Item.'Unique Identifier Column').Port.Port

Note: The 'Unique Identifier Column' represents the Unique Identifier column in your Case Entity.

 

If you configure a One-to-Many relationship from your Case Entity to your Port Entity, please consider modify above your formula as below:

First([@ModelDrivenFormIntegration].Item.Port).Port

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
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

6 REPLIES 6
Highlighted
Community Support
Community Support

Hi @Xun ,

Could you please share a bit more ahout the issue that you mentioned?

Are there records existed within your Port entity?

Further, have you faced issue with the formula you provided within your embedded app?

 

Based on the issue that you mentioned, I think there is something wrong with it. Firstly, you have something misunderstanding on the LookUp filed in CDS Entity.

Actually, the LookUp field in CDS Entity is a Many-to-One relationship in CDS rather than One-to-Many relationship. If you custom a LookUp field in your Case Entity, I think the formula you provided is proper. Please make sure the Port field (LookUp field) of the current Case record has been bind to proper Port record.

If the issue still exists, please consider take a try with the following formula:

LookUp(Case, 'Unique Identifier Column' = [@ModelDrivenFormIntegration].Item.'Unique Identifier Column').Port.Port

Note: The 'Unique Identifier Column' represents the Unique Identifier column in your Case Entity.

 

If you configure a One-to-Many relationship from your Case Entity to your Port Entity, please consider modify above your formula as below:

First([@ModelDrivenFormIntegration].Item.Port).Port

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
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

Highlighted

Hi @v-xida-msft Kris,

Thanks for your response.

And you are total right about the lookup field Port on Case Entity is a Many to One field.

There are definitly records of Port Entity, the value of the Port lookup field on Case Entity record has value.

The Canvas App is embedded on the Case Entity form (in D365)

and as far as I know the formula

First([@ModelDrivenFormIntegration].Data).Port worked with Preview, but not in the update version anymore.

In fact if I use the above Formula, the App Check mark it out as error.

According the documentation I should be able to using ModelDrivenFormIntegration.Item to get to all the values on the Case Entity record (the parent record where the Canvas App is embedded)

Sadly via the ModelDrivenFormIntegration.Item it appears to be that I get all field values on the parent record, but not lookup fields.

So what I have done so far is get the Case record using the filter and the case guid into a global var, and then suddently the Port lookup field value is returned...

This is basically the same as what you have suggested

LookUp(Case, 'Unique Identifier Column' = [@ModelDrivenFormIntegration].Item.'Unique Identifier Column').Port.Port

And that works! so for the timebeing my issue is solved.

However I am still left wondering as in why the

 [@ModelDrivenFormIntegration].Item.Port or  [@ModelDrivenFormIntegration].Item.Port.Port always returns empty...

One question for you is - when you say "Please make sure the Port field (LookUp field) of the current Case record has been bind to proper Port record."

You actually mean to ensure there is valid value in the Port lookup field on the Case record, correct? Or?

Cheers

Xun

 

 

Highlighted
Community Support
Community Support

Hi @Xun ,

I have made a test on my side based on your issue, and the issue is confirmed on my side. It seems that there is something issue with the ModelDrivenFormIntegration.Item.LookUpField formula.

 

As an alternative solution, please take a try with above formula I provided. I would also post this issue to my Product Team, if the issue is solved, I would reply here.

 

In addition, please also consider marked the following similar thread as "Solved":

https://powerusers.microsoft.com/t5/General-Discussion/Embedded-canvas-app-how-to-get-the-selected-l...

 

Best regards,

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

@v-xida-msft Kris,

Yes I can confirm that the formula you have provided works too.

Good to know that you and the prod team is on top of the issue.

Appreciated.

Regards

Xun

Highlighted

Hi,

 

You need to be specific about which value you want to retrieve if the lookup is polymorphic.

 

Following link explain in detail about the same.

 

https://pavankumargarlapati.wordpress.com/2019/08/06/embedded-canvas-app-how-to-get-the-selected-pol...

 

In case my answer helped you, please mark it as answered.

Regards,

Pavan Kumar Garlapati

Highlighted
Frequent Visitor

I can confirm the issue as well. Shame they did not test this properly so we have to create workarounds that need to be refactored when the issue is fixed. I also think that the workaround has a negative performance effect.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (8,771)