Skip to main content

Part 4: Processing appointments

This part closes the loop: 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 (re)scheduled in Dime.Scheduler, you'll reach back to the underlying application (the Excel file) and update the task. 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 fourth post in the guide on how to integrate Dime.Scheduler with Microsoft Excel through the Power Platform:

  • Part 1: Setting up the connector
  • Part 2: Resources
  • Part 3: Tasks
  • Part 4: Processing appointments

In this post, you will learn:

  • How to post back to a Power Automate Flow
  • Update the Excel file with appointment info

Step 1: What happens when you schedule an appointment​

Unlike the standard connectors that Dime Software provides, your Power Platform solution does nothing by default 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 information, you build that behavior yourself.

That's where the webhook connector comes in. As soon as you change the planning, the webhook connector sends an HTTP POST request to your endpoint of choice with the entire appointment data graph. From the request body you can navigate the graph and pull out the details 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.

Since a Power Automate flow can be invoked with an HTTP request, that endpoint can be a flow of your own. In this example, the flow goes back to the Excel file on SharePoint and sets the 'Finished' status to true when a task has been scheduled:

Step 2: Create a flow​

To keep this flow simple, make one small addition to the flow that creates tasks: add the Number column to one of the free text fieldsFree 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..

Run this flow again to update your tasks. Add the Task FreeText 1 column to the open taskOpen taskA task that has not been scheduled yet. It waits in the open task list to be placed on the planning board. column list to confirm that the values from the Number column landed correctly in the free text property.

The postback uses this information to find and update the right row in Excel. Create another Power Automate flow, this time with a different trigger. Select "When a HTTP request is received" and paste the following JSON into the text area:

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

The Power Platform parses this JSON and generates variables you can 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 return to the original Excel file and update the row of the scheduled appointment, select the 'Update a row' action and point it back to the original Excel sheet.

The Key Column and Key Value tell the Power Platform which column to use and which identifier to look for. Here, the Number field in the Excel sheet serves as the unique field. Scheduling an appointment sends Dime.Scheduler's entire appointment data graph, so you map the data once more, this time in the other direction (from Dime.Scheduler back to the Power Platform). Because you added the Number field to the task's FreeText1 field earlier in this step, the lookup is straightforward. To update this record, set the Finished column value to 'Yes'.

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

Step 3: Set up the connector​

When you schedule an appointment, Dime.Scheduler figures 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. Recall that every flow specified a SourceApp value of 'SharePoint'. 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 a record carries that value and a valid URI pointing to the back-office system. Here, 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, consider a testing site such as webhook.site, which also shows you all the fields and values that Dime.Scheduler publishes.

Step 4: Test​

With the Power Automate flow and 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 correct row:

Congratulations: you now have a two-way message flow between Dime.Scheduler and the Power Platform. From here, the possibilities are wide open. The appointment graph carries all the details of the scheduled work, along with references to the original items, so you can build rich, powerful solutions on top of it.