Skip to main content

Part 2: Processing appointments

In this part, you'll push changes back to the underlying application: when a taskTaskA unit of work that belongs to a job. It appears in the open task list until it is scheduled to a resource. is scheduled or rescheduled in Dime.Scheduler, you'll update the matching To Do item. You'll do this with the webhook connectorWebhookThe generic connector that POSTs every appointment change as JSON to a URL you choose. It delivers the message and leaves interpretation to the receiving system. and an HTTP-triggered Power Automate flow.

info

This is the second post in the guide on how to integrate Dime.Scheduler with Microsoft To Do through the Power Platform:

  • Part 1: Tasks
  • Part 2: Processing appointments

In this post, you will learn how to:

  • Post back to a Power Automate flow
  • Update the To Do item with appointment info
caution

This tutorial assumes a Power Platform connection for the Dime.Scheduler has already been created. If you haven't done so, make sure to check out the Excel tutorial.

Step 1: What happens when you schedule an appointment​

Unlike the standard connectors that Dime Software provides, your Power Platform solution does nothing on its own when you modify an appointmentAppointmentA task scheduled to a resource for a specific period - the scheduled instance you see on the planning board. on the planning boardPlanning boardThe main graphical scheduling surface where dispatchers drag tasks onto resources across a timeline.. If you want to act on appointment changes, you have to build that yourself.

This is where the webhook connector comes in. Whenever you change the planning, the webhook connector sends an HTTP POST request to the endpoint of your choice carrying the entire appointment data graph. Inside the request body, you can navigate the graph and pull out what you need: who is assigned, when and where the work takes place, and more. For a complete overview of what's in the graph, see the API reference.

Because a Power Automate flow can be triggered by an HTTP request, you can point the webhook straight at a flow, which is exactly what you'll do here. In this example, you'll go back to the To Do item and set its Due Date field to the appointment's end date:

Step 2: Create a flow​

tip

Also consider the triggers that ship out of the box in Dime.Scheduler's connector.

Create another Power Automate flow. This time, use a different trigger. Select "When a HTTP request is received" and paste the following JSON in the text area:

{
"type": "object",
"properties": {
"EndDate": {
"type": "string"
},
"Task": {
"type": "object",
"properties": {
"FreeText1": {
"type": "string"
}
}
}
}
}

The Power Platform parses this JSON and generates variables for you to use in later steps.

info

The JSON that is actually posted is much, much larger. We trimmed it here to keep the example focused. To see the entire data graph, use a network monitor or a testing tool such as webhook.site.

To update the To Do item, you first have to retrieve it. Add the 'Get a to-do' action, select the target list, and use the FreeText1 variable in the to-do task field. Recall that you stored the To Do's identifier in this free text fieldFree fieldOne of the unmapped fields on jobs, tasks and appointments that a back office can fill with its own data, each with a localizable caption., which you now use to fetch the original item from the To Do list.

Next, add the 'Update to-do' action and fill out the fields you want to update. The first two fields identify the item to update, so set the list and the Id of the item you fetched in the previous action. Since you're using the appointment's end date as the task's due date, set that field too.

If all went well, your flow should look like this:

Save the flow and copy the value from the HTTP POST URL field of the HTTP trigger at the top of the flow.

Step 3: Set up the connector​

When you schedule an appointment, Dime.Scheduler works out which back-officeBack officeThe ERP or business system Dime.Scheduler plans for - most often Microsoft Dynamics 365 Business Central. It owns the master data and remains authoritative over what it receives. system to notify. Remember that you set a SourceApp value of 'TODO' in all of your flows. When such a task is scheduled, Dime.Scheduler looks for a connectorConnectorAn integration that links Dime.Scheduler to a back-office system, routing data in and scheduling decisions back out. with the same value.

On the connector setup page, make sure there is a record with that same value and a valid URI pointing to the back-office system. In this scenario, you want to invoke the Power Automate flow you just created. Create a new record, specify the same source application as the jobs and tasks you created, tick the checkbox, select 'Webhook' as the back-office system, and paste the URL of the Power Automate flow trigger:



tip

To test this connector, you can also use a testing site such as webhook.site, which shows you all the fields and values that Dime.Scheduler publishes.

Step 4: Test​

With the Power Automate flow and the Dime.Scheduler connector in place, it's time to test. Pick any task, drop it on the planning board, and check the Power Automate flow history.

And sure enough, the flow has updated the To Do item:

Congratulations, you've now set up a two-way message flow between Dime.Scheduler and the Power Platform. From here, there are no limits. The appointment graph holds all the information about the scheduled work, plus references back to the original items, so you can build rich and powerful solutions on top of it.