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

Embedded canvas App + Get Lookup Value and change display mode of a field

Hi All,

 

I have an embedded canvas app on the CRM Form. I need to get the lookup value of a field.

 

The relationship is as follows -

"Entity A has a lookup of Entity B on it"

"Entity B has a lookup of Entity C on it"

 

The embedded canvas app is on Entity A
I need to get the "Entity C" value inside the embedded canvas app.

I tried the below things -

1) Set the below formula on the "onvisible" property of the form screen
ClearCollect(EntityBRecord,LookUp('EntityB','entitybid'=[@ModelDrivenFormIntegration].Item.'LookupofEntityBonEntityA'.'id');

2) Placed a label on the form and set it text property to First(EntityBRecord).Name 

But the label does not display anything 😞

 

Moreover I need to check if the "Entity C" lookup on "Entity B"  has a value, if yes, then make the display mode of the field "Disabled" otherwise "Editable".

 

formula pseudocode for the datacardvalue-


If('Entity C contains data',Parent.DisplayMode.Disabled, Parent.DisplayMode)

 

Kindly provide any guideliness/syntax on how to achieve this.

 

Any help would be appreciated.

 

 

 

1 REPLY 1
Super User II
Super User II

@Poweruser1101 
Can you try this for the OnVisible property of the form screen? 

Set(gblContextualRecord, LookUp(EntityA, ID = [@ModelDrivenFormIntegration].Item.ID);
ClearCollect(EntityBRecord, LookUp(EntityB, ID = gblContextualRecord.LookupOfEntityBonEntityAID))

And you can then use this to check if EntityC has data:

If(IsBlank(First(EntityBRecord).EntityC.ID), DisplayMode.Disabled, Parent.DisplayMode)

Let me know if this works. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Microsoft Certified Trainer MCT

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

 

 

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

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

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (26,770)