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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Multiple parameters with Power Apps Host control

(5) ShareShare
ReportReport
Posted on by 158
Hi
 
I'm investigating if we can replace an HTML/Javascript control with a Power App. To do so I would need to pass more than one parameter from Finance to the Power App. Alternatively, I can pass a JSON or some kind of structured string to the Power App, but I would need to be able to build the string programatically because the data is not available in a single table or field.
 
I'm wondering if anyone else has experience with something similar. So far I see 4 possible options, but I am not sure how good they are.
  • I've tried to see if I can write to the PowerAppsHost "EntityId" property programmatically via an event, which seems to be possible. I've not been able to test if I get the value into the Power App, but I have some reservations when it comes to this way of doing it. I'm afraid that there will be something else writing to this property later, or I feel this way of doing it is a bit dirty somehow. I would not expect it to work, but it's just a feeling I have.
  • I found this article describing creating an extension or duplicate of the PowerAppsHost control: https://www.linkedin.com/pulse/expand-dynamics-foscm-power-apps-integration-oleksandr-dudarenko . I guess this is an option, but then it becomes pretty complicated and I'd rather not maintain it. This is part of the reason we want to use the Power App in the first place.
  • I can extend a table with a new field where I programmatically write the value I need to pass to the Power App, but I am not sure when or how to write to the field and if I can keep it updated. It seems like a workaround that I am not sure is feasible. I would like to avoid it if I can.
  • I've found what seems to be official documentation of the Power Apps Host control here: https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/user-interface/powerapps-host-control . On item 4 under "Host an app from Power Apps on a page" they describe using a "DataMethod". It's not entirely clear to me what they mean by this, but I suppose it similar to a display method. I've tried to use a method in the property "Entity ID Method", but I always end up with an error saying that the method cannot be found on the data source. I've tried using my own table as a data source, but mainly I want to extend some standard tables like CustTable. I've tried that as well, but with the same error. I am not sure if the method must be on the configured data source. It would be better if it didn't have to be. Experimenting with this eventually caused a problem crashing IIS Express with an exception "Attempted to read or write protected memory", which I spent several hours to get rid of.
So I'm wondering if anyone has some thoughts on this, and possibly other ideas. I was also hoping that I could get some help when it comes to the syntax and how to use the "Entity ID Method" as described in the last bullet point. If I can use this property to pass a computed value to my Power App, this seems like the correct way to pass more than one parameter.
 
Thank you, and best regards!
 
I have the same question (0)
  • Jonas "Jones" Melgaard Profile Picture
    4,894 Super User 2025 Season 2 on at
    Multiple parameters with Power Apps Host control
    What type of form is it?
    In my experience, I usually pass a key to my app and then fetch additional data in F&O as needed. Creating a JSON directly in the form seems a bit cumbersome.
  • hca Profile Picture
    158 on at
    Multiple parameters with Power Apps Host control
    Hi @Jonas "Jones" Melgaard, the form could be CustTable, Vendor, etc. It's multiple forms. Temporarily I can solve it by having one app for each form, but I would like to avoid that.
     
    When you say that you pass a key, how do you mean? Do you use the standard field or is there some other way?
  • hca Profile Picture
    158 on at
    Multiple parameters with Power Apps Host control
     
    For now it seems like our chosen option is to write to "EntityId" of the "PowerAppsHost" via a form event handler, but I will leave this thread open because this is not the preferred way for us. This way of doing it comes with a warning which is described in the post mentioned before. If you programmatically write to "EntityId", while a data source and field is already selected in the control, the value you write will be sent back to the field in the data source too.
  • hca Profile Picture
    158 on at
    Multiple parameters with Power Apps Host control
    I've found a way to use the "Entity ID Method" of PowerAppsHost.
     
    First of all, the syntax in "Entity ID Method" is "MyClass.MyFunction". I guess this depends on whether the method is static or not. There is no combo box on this field like there are in other controls, so you have to type the function name manually. In my case, the function was added as an extension to the data source table.
     
    Now here is the "interesting" part. I could not understand why it was not working, so I tried to add another control to the form, a regular string control. When using this control, you can choose data source and method via combo boxes. When this extra control is present in the form, now the PowerAppsHost suddenly starts to work too! So, for me, I have to keep a hidden string control in the form, pointing to my method, and then the PowerAppsHost can get the EntityId property from my function.
     
    I will not make this the suggested answer, because I don't think it should behave like this, but I'm leaving my post here for others who might come across it.
     
     
  • Gerard Verbruggen Profile Picture
    130 on at
    Multiple parameters with Power Apps Host control
    Hi hca,
     
    I had a similar issue where I wanted to use the recId (LedgerJournalTrans), but for some reason I couldn't get it to work with a powerapps/powerflow where the recId field just did not show up in PowerFlow. Still not sure why. Then I found your post here which saved my day. 
     
    It indeed is very odd, but at least it works. I seem to remember that I read somewhere that the field indeed needs to exist on the form if you want to use it in the PowerApps control.
     
    Thanks for the post !
    Cheers,
    Gerard

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 756 Super User 2025 Season 2

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 678

#3
Martin Dráb Profile Picture

Martin Dráb 526 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans