Search code examples
javascriptworkflowdynamics-365

How to get a hidden field's value from a Dynamics email workflow?


We have a functionality in our Dynamics, where:
1- Record gets created/updated.
2- Call an API.
3- Stores the API's return value in a hidden text. (created a webresource html and attached to the form)
4- Triggers an Email notification workflow via JS.

Our challenges is that #3 has a value that needs to be in #4 (the email).
We didn't create a field in the form's entity to store the API call in #3, we just wanted to use that returned value as part of the email notification.

Please advise...


Solution

  • quick question: Does your each record has unique API return value per record? Two ways and I would personally prefer option 1

    1. If yes then why not create a field in Entity itself and save that value in CRM. You can easily use that for your transaction
    2. Why not create a Input parameter for Email notification workflow and pass this value in workflow, which then can be used for Email notification. (If you call an API using Js or c# code and get value back (same context of Js/C# code))