Custom Integration - Manual Two Way Sync

I have been working on a Quickbooks Time/TSheet integration with the intention of using it to set up a two-way sync. Rather than the automatic syncing demonstrated in the Jira integration, this integration uses buttons to manually save/revert changes. The current workflow works something like this:

  1. Get Quickbooks Time data at a set interval (no webhook is available from QB Time)
  2. Create/Update/Delete entities using rules in a mirror writeable database for each datatype that you would like to edit. Generally this means have two spaces, one for the integration and one for the editable data.
  3. Use buttons in the editable databased to make Create/Update/Delete requests to the integration app (I prefer to post to the integration app and then to QB Time so I can managed the integration app security rather than having to put QB Time API keys in the script)
  4. On success, automatically update the corresponding entities using a webhook from the integration app.

This is a very broad overview and there are lots of little details to get right, however in the process of creating it I realized there were a few features that could massively simplify the process:

  1. Batch arguments for External Actions

    • Currently external actions are executed for each entity. This creates a ton of requests and slows execution if you’re using external actions to Create/Update multiple entities. You can get around this using scripts instead of External Actions but you totally miss out on the benefit of having all of the account information. I think the easiest way to do this would be to allow External Actions to be used in scripts, so you can pass a batch argument to a normal External Action.
  2. Entity creation in integration DBs

    • It seems to be possible to add new entities via the API/scripts, but there’s not a good way to it in the UI. This makes complete sense for normal integrations, but it would be great to be great to have the option for the manual two-way sync use case which I will explain below.
  3. Add editable fields to be added via integration schema

    • For the manual two-way sync there are a number of expected editable fields that it would be great to be able to build as part of the integration. I realize this could also be done via the UI or the general API, but this would make it much easier to share the full manual two-way integration, rather than the one-way sync and instructions.

These changes should make fairly straightforward to make manual two-way sync integrations. Here would be the improved workflow:

  1. Get Quickbooks Time data at a set interval. If the pre-sync editable and read-only fields match (ie. they are synced), overwrite both the editable and read-only fields. If they do not match (ie. there are unsaved changes) overwrite the read-only fields and set an pending changes checkbox to true.
  2. Update the editable fields as desired or create a new entity. Changes/additions can either be posted to the integration app (Save button) or reverted to the values of the readonly fields (Revert button). Updates are grouped in batches to limit requests.
  3. On success from TSheets, update the readonly fields of the respective using a webhook from the integration app.

I would also probably set up a formula that returns different status values based on different checkboxes. (ie. “Synced”, “Pending Changes”, “Incoming Changes”, ect.)

1 Like