Articles in this section

Set a custom trace key to uniquely identify a record

A trace key is the value assigned to a field — such as Internal ID — that uniquely identifies a record. Knowing a record's trace key lets you reference that specific record throughout a flow. integrator.io determines a default trace key automatically, using metadata to find the field most likely to be unique for a given endpoint and record, and in most cases you can accept that default. This article covers where to find a record's trace key and how to override the default when you need to.

The trace key matters beyond troubleshooting a single record:

  • How automatic error resolution works uses the trace key to recognize and auto-resolve duplicate errors.
  • The trace key is the field integrator.io uses to identify a record when auditing flow event data.
  • Searching by trace key makes records easier to find in integrator.io reports and error information.

View a record's trace key

You'll find a trace key value in either of these places:

  • A downloaded flow event CSV file (generated from Build build-icon.png, and then Reports) — in the first column, traceKey.
  • The error details on the Errors page, under the error's Fields.

    Error details with the trace key field

Trace keys are limited to 256 characters. If a trace key would exceed that limit, integrator.io removes characters from the middle of the value while preserving both the beginning and end of the string — this keeps long trace keys distinguishable from each other and reduces the risk of a false duplicate-detection caused by truncation.

Override the default trace key

Overriding the default gives you flexibility to meet your own business requirements and make later troubleshooting easier. In some cases integrator.io can't determine a unique value for a record at all, leaving the trace key blank — when that happens, overriding the default is strongly recommended.

Trace key overrides are available only for custom ("DIY") flows; they don't appear in Integration app flow steps.

Set a trace key in an export or listener

In a custom flow, you can specify an alternate field, combination of fields, or concatenated value to use as the trace key for a step's source application. Because you're setting this in the export or webhook listener step, the new value is referenced throughout the rest of the flow.

For example, if a record looks like this, and product_code is currently assigned as the trace key field:

{
  "record": {
    "product_name": "Pillow Case",
    "product_code": 144,
    "updated_at": "2021-04-15 10:08:29",
    "created_in": "Store View B",
    "category": 8,
    "inventory": 40,
    "color": "goldenrod",
    "addresses": []
  }
}

...you might want a more human-readable trace key than "144":

  1. In Flow Builder, select the export to edit it.
  2. Expand the Advanced section.
  3. In the Override trace key template setting, enter a field — such as {{record.product_name}} — or a Handlebars expression, such as {{join "-" record.product_name record.product_code}}.
  4. Optionally, select Open handlebars editor Open handlebars editor icon to test how the template resolves against a sample record.
  5. Select Save and close.

Using the second example above, the trace key for this sample record would resolve to "144, Pillow Case: goldenrod" and be searchable as such. The same procedure applies to a listener.

Override trace key template setting on an export

If you've applied a transformation to the exported data, reference its fields in the trace key template without the record. path — for example, {{product_name}}. The same applies if you've added a JavaScript hook to the exported data; the Script editor's Function input shows the result data, and you can set the traceKey path accordingly.

Set a trace key for imported one-to-many records

If an import contains a one-to-many lookup — meaning you're syncing source child records that should each be treated as their own main record — you have an additional opportunity to provide a custom trace key template for those child records. integrator.io attempts to assign a default trace key for each one, but the override gives you more control.

The child record's trace key always includes the parent record's trace key, in the format:

<parent_record_trace_key> - <child_record_trace_key>

When you create or edit a one-to-many import in Flow Builder, or from Resources resources-icon.png, and then Imports, this is the Override child record trace key template setting.

Override child record trace key template setting on an import

Trace key overrides reference

Export setting Import setting Resulting error trace key
Trace key template value set by the user (for example, order_id); one-to-many configuration not set Trace key template value set by the user (for example, order_id) Computed in the export step (order_id)
Trace key value set by the user (for example, order_id); one-to-many configuration set, child trace key not set Trace key template value set by the user (for example, order_id) If the system can't set a default child trace key: computed in the export step (order_id). If it can: <order_id> - <child_record_trace_key>
Trace key template value not set by the user; one-to-many configuration set, child trace key set to order_line_item[*] One-to-many configuration set, child trace key set to order_line_item[*] A combination of export and import configuration (order_id - order_line_item[*])
— One-to-many configuration set, child trace key set to order_line_item If the system can't set a default trace key: computed in the import step (order_line_item). If it can: <parent_record_trace_key> - <order_line_item>