Delay of Integration

1     Overview

Delayed integration is configured via a webhook. In case delayed integration is turned on, upon saving a record Portal will start a flow which will send a notification to a user with higher privileges, like a manager, what was the change without actually applying the change. If the manager approves the change, a method from Portal Connector can be called in the flow to apply the change. The new values are stored in a database record until Portal Connector is called to process them. Once processed, the changes cannot be applied again even with a subsequent call to Connector with the same parameters.

2     Configuration

Web Hook

  1. Navigate to Portal application, then go to Webhooks.
  2. Service should be set to the service for which to enable the delayed integration feature.
    Delayed integration is supported only when Action is Edit / Save.
    Trigger URL can be obtained from Power Automate, create new empty flow with action When an HTTP request is received:
  3. In Service Fields you can define for which fields the webhook will send values to the flow. There will be both the old and the new value, which allows to compose a notification to the user what was changed.
  4. Service Line-Item Fields will allow you to send values for line-item fields, if your service supports line item updates.
  5. Delay Integration must be checked, which enables a new field called Integration Field. The integration field is a field on the record being updated (should be Boolean), which is set to true when a record is updated with delayed integration. Once the changes are applied via Portal Connector this field is reset back to false. This functionality enables Portal services to filter out records which are pending delayed integration and do not show such records. This way users will not be able to make more changes to the record until the current pending changes are applied to avoid collisions.

Power Automate

Note: there is an example flow in Demo, called Sales Order Delayed Integration from Portal

In your flow you need to paste the schema for the webhook data, that will be sent to it when the webhook is triggered with an update action (user clicks Update button on a record) in Portal.

  1. Schema can be exported from the list of Webhooks:
  2. Copy the contents of the file that was just downloaded and paste them in the first action your flow:
  3. You can continue your flow, for instance you can send a notification email with the old and new values:
  4. In this case for each service field, we are going to send an email.

    Note: the email will be sent when the webhook is triggered

3     Testing

Update a Record

  1. Once the service and webhook are configured, navigate to your service. There is a working example in demo:
  2. Click Edit for a record and change a value:
  3. Note that when you click Update, the values will not change in the grid.
  4. But a new record will be created in the database, waiting to be applied.

Apply Change

  1. Changes can be applied with a call to Portal Connector in flow.
  2. For demonstration and testing purposes we can make that call directly in Power Automate from Connector’s configuration.
  3. Navigate to PowerAutomate in Demo and click Edit for Portal Connector:
  4. Go directly to Test tab and click on ProcessDelayedIntegration action:
  5. Please note there are two special parameters SPHostUrl and SPAppWebUrl. Here they are set with default values to connect with the demo portal site. In real implementations these values will have to be configured in your flow.
  6. Here, for testing purposes we can specify the id of the integration record in the database manually. In real implementations the webhook request to the flow will contain the id in a special field called DelayedIntegrationId.
  7. Click Test operation button. If all is OK, you should see a response similar to this:
  8. Check the database record, it should also have changed its status to Succeded:
  9. Now reload the service and note how values have changed:
  10. Integration field was also unchecked, which allows the service to show the updated record.