Technology. People. Progress.
Dynamics 365

Create a provider message request handler in Dynamics 365 IOM

Set up the request handler for the tutorial’s quick-start scenario.

Create a provider message request handler in Dynamics 365 IOM

Microsoft Dynamics 365 Intelligent Order Management IOM Step by Step Tutorial

Follow Below Steps

Step 1 - COMPLETEDCreate the free 30 Days Trial Version Environment for the Microsoft Dynamics 365 Intelligent Order Management

Step 2 - COMPLETEDSet up an IOM environment / Configure platform connection references in Microsoft Dynamics 365 Intelligent order Management

Step 3 - COMPLETEDCreate a new solution for PROVIDER Customization in Microsoft Dynamics 365 IOM / Create a provider solution

Step 4 - COMPLETEDCreate RequestBin Custom connector (Power Platform) for Step by Step Microsoft IOM Tutorial

Step 5 - COMPLETEDCreate new intake provider definition for Step by Step IOM Tutorial Scenario- Microsoft Dynamics 365 Intelligent Order Management / Register a new Provider in Library

Step 6Create a provider message request handler for Quick Start Lab Scenario for Microsoft Intelligent order Management IOM tutorial

Step 7Create Fulfillment provider in Microsoft Dynamics Intelligent Order Management IOM – Order to Fulfillment in IOM

Step 8Add a provider definition logic definition to the Outlook Provider Definition in Microsoft Dynamics Intelligent Management IOM

Step 9Create a provider action - Power Automate Flow - to send a fulfillment Order payload to RequestBin

Step 10Activate the Intake, Fulfillment, & Internal Application Service provider created in Previous Step by Step IOM Tutorial

Step 11Create Orchestration policies and their associated rules for Quick Start Lab Scenario in Microsoft Dynamics 365 Intelligent Order Management IOM

Step 12Create Sales Order Orchestration flow in Microsoft Dynamics Intelligent Order Management IOM

Step 13Set up Customer(Account) and product mapping in Microsoft Dynamics Intelligent order Management IOM

Step 14Run a sample order orchestration flow in Microsoft Dynamics 365 Intelligent Order Management - END TO END DEMO IOM

Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab

To create a provider message handler, follow these steps.

  1. Go to the Power App Maker portal, navigate to Solutions, and create new Solution named IOM Lab Provider Workflows .
Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 1 View full size

2. Select New > Automation > Cloud Flow > Automated,

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 2 View full size

3. Select Cloud Flow, and name it “IOM Lab Order Intake Message Request Handler”.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 3 View full size

4. Search for the trigger type as Outlook.com – When a new email arrives (V2), and click on Create then sign in with your outlook.com account credentials.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 4 View full size

5. Enter the required information in the field

  • For Folder, select Inbox.
  • For To, select Recipient email addresses separated by semicolons.
  • For CC, select CC recipient email addresses separated by semicolons.
  • For To or CC, select To or CC recipient email addresses separated by semicolons.
  • For From, select Sender email addresses separated by semicolons.
  • For Include Attachments, select Yes.
  • For Subject Filter, select IOMLabOrderIntakeOrder.
  • For Importance, select Any.
  • For Only with Attachment, select No.
Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 5 View full size
Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 6 View full size

6. Select New step .

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 7 View full size

7. Search for Data Operations Add “Parse JSON“.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 8 View full size

8. Paste the Code in the Content given below

Code example
{
"ProviderId": "00000000-0000-0000-0000-000000000000"
}
Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 9 View full size

9. In the Schema field click on Generate from Sample.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 10 View full size

10. Copy the same sample code that you paste it into the Content Field and click on done.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 11 View full size

11. As you can see the sample code is converted into the Sample Schema Code in JSON format.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 12 View full size

12. Select the ellipsis (“…“) and then select Rename.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 13 View full size

13. Rename the action “IOM System Properties” and click on Save .

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 14 View full size

14. Select New step, add a Parse JSON action, and rename to “Initialize Provider Variables“.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 15 View full size

15. In the  Content, paste the below code: 

Code example
{
"SourceObjectName": "IOMLabOrderIntakeProvider",
"DestinationObjectName": "Dataverse Order"
}
Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 16 View full size

16. Copy the same sample code that you paste it into the Content Field and click on Done.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 17 View full size

17. As you can see the sample code is converted into the Sample Schema Code in JSON format.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 18 View full size

18. Select New step search for Variables Add  Initialize variable action,

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 19 View full size

19. Rename the action “Initialize Processing Execution Result” and click on  Save 

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 20 View full size

20. Enter the Name  “ExecutionResult” and for Type, select Boolean.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 21 View full size

21. Enter the Value, select true from the Expression and click on OK.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 22 View full size

22. Select New step, search for Control and add “scope”

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 23 View full size

23. Rename the scope to ‘ Try ‘.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 24 View full size

24. In the Try scope, select Add an action then search for Microsoft Dataverse Connector select “perform an unbound action” .

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 25 View full size

25. Rename it “Acknowledge the Provider Message in IOM“.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 26 View full size

26. Enter the appropriate details in the respective fields.

  1. For Action Name, enter “msdyn_CreateProviderMessageRequestExecution”.
  2. For PowerAutomateWorkflowId, copy the given below expression
Code example
workflow()['tags']['xrmWorkflowId']

3.For PowerAutomateRunId, copy the given below expression

Code example
workflow()['run']?['name']

4.For ProviderExternalRequestId, copy the given below expression.

Code example
guid()

5.Select Save.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 27 View full size

27. Select Add an action, search for Control Connector and then add an Apply to each control.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 28 View full size

28. For Select an output from the previous steps, select Attachments.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 29 View full size

29. Select Add an action within the Apply to each loop

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 30 View full size

30. Search for  Flow connector and Add Run a child flow .

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 31 View full size

31. Rename it “Transform Message with Power Query Online“.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 32 View full size

32. Enter the appropriate details in required  fields.

  1. Select the child flow IOM Provider Transformer.
  2. For Provider Id, select the ProviderId variable.
  3. For Source Object Name, select the SourceObjectName variable.
  4. For Destination Object Name, select the DestinationObjectName variable.
  5. For Payload, copy the given below expression .
Code example
decodeBase64(items('Apply_to_each')?['ContentBytes'])

6.Select Save.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 33 View full size

33. After the transformation step, select Add an action, add Run a child flow from the Flow connector, and rename it “Create Order“.

  1. For Child Flow, enter “IOM Sales Order Creation”.
  2. For Payload, copy the given below expression
Code example
string(json(outputs('Transform_Message_with_Power_Query_Online')?['Body']?['result'])?[0][0])

3. Select Save.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 34 View full size

34. Collapse the Try scope by selecting its title bar.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 35 View full size

35. Select New step, add a scope and rename it “Catch“.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 36 View full size

36. In the Catch scope, select the ellipsis (“…“), and then select Configure run after.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 37 View full size

37. Select the has failed and has timed out checkboxes, and then select Done.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 38 View full size

38. In the Catch scope, select Add an action, search for Variable  and add a Set variable action.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 39 View full size

39. Rename it “Set the execution result to failed“.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 40 View full size

40. For Name, enter “Executionresult” and in the Value, select False.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 41 View full size

41. Collapse the Catch scope by selecting its title bar.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 42 View full size

42. Select New step, add a scope and rename it “Finally“.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 43 View full size

43. In the Finally scope, select the ellipsis (“…“), and then select Configure run after.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 44 View full size

44. Select the is successful, has failed, is skipped, and has timed out checkboxes, and then select Done.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 45 View full size

45. In the Finally scope, select Add an action, add a Perform an unbound action and rename it “Save Provider message request execution result”.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 46 View full size

46. For Action Name, enter “msdyn_UpdateProviderMessageRequestStatus”.and For ProviderMessageRequestExecutionId, copy the given below expression

Code example
@outputs('Acknowledge_the_Provider_Message_in_IOM')?["body/ProviderMessageRequestExecutionId']
Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 47 View full size

47. Click on Save.

Screenshot from the DVMSKE tutorial
Create a provider message handler for step by step IOM Tutorial STEP 6 - Quick Start Lab — screenshot 48 View full size

Add provider definition logic definition to the provider definition for Quick Start Lab Scenario

To add a provider definition logic definition to the provider definition, follow these steps.

  1. In your Intelligent Order Management application, go to Providers > Catalog.
Screenshot from the DVMSKE tutorial
Add provider definition logic definition to the provider definition for Quick Start Lab Scenario — screenshot 49 View full size

2. Select the newly-created IOMLabOrderIntakeProvider and click on See details.

Screenshot from the DVMSKE tutorial
Add provider definition logic definition to the provider definition for Quick Start Lab Scenario — screenshot 50 View full size

3.  Select the Logic definitions tab.

Screenshot from the DVMSKE tutorial
Add provider definition logic definition to the provider definition for Quick Start Lab Scenario — screenshot 51 View full size

4. Select + New IOM Provider Definition Logic Definition.

Screenshot from the DVMSKE tutorial
Add provider definition logic definition to the provider definition for Quick Start Lab Scenario — screenshot 52 View full size

5.In the  New Provider Definition Logic Definition dialog box, do the following:

  • For Display Name, enter “IOM Lab Order Intake Message Request Handler”.
  • For Logical Name, enter “msdyn_LabOrderIntakeMessageRequestHandler”.
  • For Provider Definition, enter “IOMLabOrderIntakeProvider”.
  • For Logic Type, enter “Provide Message Handler”.
  • For Workflow Name, enter “IOM Lab Order Intake Message Request Handler”.
  • For Timeout Minutes, enter “2”.
  • For Max Retry Attempts, enter “3”.
  • For Description, enter “IOM Lab Order Intake Message Request Handler”.
  • Select Save.
Screenshot from the DVMSKE tutorial
Add provider definition logic definition to the provider definition for Quick Start Lab Scenario — screenshot 53 View full size

6. After click on Save button will generates a JSON representation of the message handler cloud flow and fills in the Client Data field and Select Save & close.

Screenshot from the DVMSKE tutorial
Add provider definition logic definition to the provider definition for Quick Start Lab Scenario — screenshot 54 View full size

7. Select Connections. You should see both the Microsoft Dataverse and Outlook.com connection reference definitions listed.

Screenshot from the DVMSKE tutorial
Add provider definition logic definition to the provider definition for Quick Start Lab Scenario — screenshot 55 View full size

Add provider definition logic definition and connection reference to IOMLabProviders solution

To add a provider definition logic definition and connection reference to the IOMLabProviders solution, follow these steps.

  1. Go to the Power App Maker portal and navigate to the newly-created solution IOMLabProviders.
Screenshot from the DVMSKE tutorial
Add provider definition logic definition and connection reference to IOMLabProviders solution — screenshot 56 View full size

2. Select Add existing  >  More  >  Other  >  Provider Definition Logic Definition.

Screenshot from the DVMSKE tutorial
Add provider definition logic definition and connection reference to IOMLabProviders solution — screenshot 57 View full size

3. Select IOM Lab Order Intake Message Request Handler and then select Add to add it to the solution.

Screenshot from the DVMSKE tutorial
Add provider definition logic definition and connection reference to IOMLabProviders solution — screenshot 58 View full size

3. Select IOM Lab Order Intake Message Request Handler and then select Add to add it to the solution.

Screenshot from the DVMSKE tutorial
Add provider definition logic definition and connection reference to IOMLabProviders solution — screenshot 59 View full size

4. Select Add existing  > More > Other >  Provider Connection Reference.

Screenshot from the DVMSKE tutorial
Add provider definition logic definition and connection reference to IOMLabProviders solution — screenshot 60 View full size

5. Select the Microsoft Dataverse and Outlook.com connection reference definitions and then select Add to add them to the solution.

Screenshot from the DVMSKE tutorial
Add provider definition logic definition and connection reference to IOMLabProviders solution — screenshot 61 View full size

6. As you can see all three are added into the solution.

Screenshot from the DVMSKE tutorial
Add provider definition logic definition and connection reference to IOMLabProviders solution — screenshot 62 View full size

CLICK HERE FOR STEP 7Create Fulfillment provider in Microsoft Dynamics Intelligent Order Management IOM – Order to Fulfillment in IOM

Need help applying this to your business?

Talk to our team about your systems and next step.

Talk to our team
Open original image