web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Get Work Order Id with...
Power Apps
Answered

Get Work Order Id with ModelDrivenFormIntegration in embedded canvas app when app loads.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Power Apps Community,

My issue is that I could not get the value of Work Order Id or name of WorkOrder Entity entity in my canvas app.

I created a New tab in WorkOrder View Form and embedded a new canvas app in it. I used this tutorial https://aaronkgumbs.com/2021/07/24/how-to-enable-modeldrivenformintegration-for-existing-canvas-apps/.

After using above url, We can get ModelDrivenFormIntegration Entity in canvas app.

I am using a PCF component in canvas app and I have to send WorkOrder ID in PCF component property like this.

Screenshot 2021-12-03 at 5.04.39 PM.png

According to this MS Documentation https://docs.microsoft.com/en-us/powerapps/maker/model-driven-apps/embedded-canvas-app-add-classic-designer We can get any record of the table using ModelDrivenFormIntegration.Item.accountnumber. In my case I have to use msdynworkorderid. But I am not able to get the correct record of data.every time it is giving null value.

After doing some research, it seams as the ModelDrivenFormIntegration control has not been initialised yet when app loads.

So i check this blog which shows 2 possible solutions https://carinaclaesson.com/2020/05/30/exploring-the-modeldrivenformintegration-control-in-embedded-canvas-apps/

Add a timer or set the formula on the RefreshData property of the ModelDrivenFormIntegration control.

Both solutions doesn't work and Used formulas are also giving Errors.

 

Looking forward to your solution / advice.

Many thanks,

Dhruvil

Categories:
I have the same question (0)
  • Verified answer
    PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    Hi @Anonymous , 

     

    Are you suggesting that you are not getting the value of a column of a related table? If so, suggest looking up the contextual record first and then using it to fetch the related table's column value(s). 

     

    On the app OnStart, I always do this:

    Set(gblRecord, LookUp(Table, GUID = ModelDrivenFormIntegration.Item.GUID))

    Then get the related table's value like this:

    Set(gblRelatedTableValue, gblRecord.RelatedTable.Column)

    Here is a blog I have on everything related to embedded canvas apps: https://thepoweraddict.com/everything-you-need-to-know-about-embedded-canvas-apps/ (Post #3).

     

    Let me know if this helps. 

     

    ---
    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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @PowerAddict 

    Thanks for your suggestion.

    I don't want to get data from related tables. I need to retrieve the data of current work order data in which I have added my canvas app.

    In simple way, I only want to show the Work Order display name in my Canvas app.

    Screenshot 2021-12-16 at 11.29.58 AM.png

    Instead of ```abcd``` I need to print WorkOrder Name(Text) which is ```00507```

     

    EDIT: I also tried formulas suggested by you but they started giving me formula errors.

    Screenshot 2021-12-16 at 11.34.47 AM.png

     

    Thanks!

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    That should just be this:

    LookUp('Work Orders', 'Work Order' = [@ModelDrivenFormIntegration].Item.'Work Order').'Work Order Number'

    Replace 'Work Order Number' with the column name for work order number. Let me know if this doesn't work. 

     

    ---
    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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried your formula but it started giving these errors in the formula itself. 

    1. The function 'LookUp' has some invalid arguments.

    2. Incompatible type. We can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app.

    Screenshot 2021-12-16 at 4.40.43 PM.png

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    Well, I assumed column names. You need to replace 'Work Order' with whatever the name is of the GUID column on the Work Orders table and replace 'Work Order Number' with whatever the name is of the work order number column. Let me know if this helps. 

     

    ---
    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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I am also facing the same problem

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried this solution by replacing 'Work Order' with msdyn_workorder. I checked this form here.

    But the result is the same. For reference, I am adding the Canvas app here.

    msdyn_workorder EntityType 

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried this solution by replacing 'Work Order' with msdyn_workorder. I checked this from here https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/msdyn_workorder?view=dynami... .

    But the result is same. For reference I am adding Canvas app here.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried @PowerAddict 's suggested blog and compared the canvas app with my canvas app and I managed to make it work by adding a Work Order Table in Canvas app.

    Screenshot 2022-01-05 at 12.45.28 PM.png

    Now i can get current work order record in the canvas app using this formula 

     

     

    ModelDrivenFormIntegration.Item.'Work Order Number'

     

     

    Thanks @PowerAddict,

    It was very useful blog https://thepoweraddict.com/everything-you-need-to-know-about-embedded-canvas-apps/.

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    Glad I could help! Good luck with the rest of the app! Feel free to reach out in case of any questions!

     

    Thanks!

    Hardit Bhatia

    Microsoft Business Applications MVP

    Microsoft Certified Trainer MCT

    Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard