Articles in this section

Filter Intercom data to configure a delta export

A delta export retrieves only those matching records that were changed or created since the previous flow ran or a specified date. Certain Intercom API requests do offer the Delta export type as a built-in option. However, integrator.io is not always able to set the Intercom query parameters to check the “last exported” (lastExportDateTime) value that it typically relies on to export only unsynced records.

As a safeguard, you can achieve full delta functionality in the Intercom API by setting an output filter on the exported records, as described below. In short, this example compares the “last exported” value returned by Intercom with a record’s “updated at” value. 

  1. Create an Intercom export with the following settings:
    • Resource: Contacts
    • Operation: List all contacts
  2. Click the Preview button, and record the JSON path to the “updated at” field in the response data – in this case, updated_at

  1. Save and close the export.
  2. Returning to Flow Builder, create an output filter:
    1. Click Define options (+) on the export, and select Output filterOutput filter button ). The Define output filter panel opens with an empty initial rule. 
    2. Click to edit the Operand settings (Settings (gear) button), set the Operand type to Expression, and click Save to close the dialog. 
    3. Paste the following expression into the first operand field, where updated_at is the value from step 2 (see image below):
      ["subtract",["number",["extract","updated_at"]],["divide",["epochtime",["context","lastExportDateTime"]],1000]]
    4. Choose is greater-than for the operator.
    5. Change the second operand’s Operand type to Value and its Data type to Number, and set its value to 0.
  3. Save and close the filter, and run the flow.

This new filter excludes all records that were modified before they were last exported, based on calculating the difference between the timestamps in updated_at and lastExportDateTime (after converting it from milliseconds to seconds). Thus, a record with a positive value – meaning that its “last exported” date/time is earlier than its “updated at” date/time – proceeds in the flow. 

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.