The Preview panel in the import editor builds the request integrator.io will send to the destination from a sample record, shows it to you, and — only when you choose — sends it so you can see the destination's response. Use it to check the request body, headers, and URL before the flow runs, and to capture a real response to build response mappings from. It's available on imports that use an HTTP-based connector. This article explains where the sample record comes from, how to edit it, and what each part of the panel shows.
Preview the request an import will send
- Go to Build
> Flows, open the flow, and then select the import step to open its editor.
- On the Input tab, review the sample record. To change it, edit it in place; see Edit the sample record.
- On the Preview tab, select Preview request. The request built from the sample record appears under Request.
- Review the request URL, body, and Headers.
- To see how the destination responds, select Send. The sample record is written to the destination application.
Nothing is sent to the destination until you select Send.
Where the sample record comes from
The sample is one record: the first record of the source export's Mock output when mock output is saved, otherwise the first record retrieved from the source application. That record then passes through the same steps it would in a run — the export's transformation, output filter, and hooks, then every step before the import.
A test run of the flow sends the whole first page of records through those steps, so the two can disagree: a test run can deliver records to the import while the preview has no sample record, or shows a different one. The usual cause is that the export's output filter, or a branch or input filter before the import, excludes the first record even though later records pass. To preview a record that passes the filters, put one first in the export's mock output — see Provide mock output data for exports and lookups — or edit the sample record. To see which records reach the step, run the flow in test mode; see Debug a flow in test mode.
A lookup step before the import is another reason the two can differ. In a step's Input tab, the Preview panel, and the Results mapping preview, a lookup contributes only one record: the first record of its mock output when mock output is saved, otherwise the first record its request returns. A results mapping that copies the lookup's whole result list onto the record shows a list of one. A test run and a real run hand the results mapping every record the lookup returns. A later step can therefore have no sample record although the flow runs correctly — for example, a One to many import whose filter keeps other records of the list, or a step whose filter or mapping totals a field across the list; Preview request and Send then report that you must add at least one mock input record. To preview with a representative record, put it first in the lookup's mock output, or edit the sample record.
Edit the sample record
Edit the record on the Input tab when the source isn't configured, or when the retrieved record doesn't represent the case you want to test — a record type the first record doesn't cover, say. The editor shows the record as JSON; change it in place and the preview uses what you typed.
- If the mock data groups records, so the record is an array of arrays (
[[{ }, { }], [{ }]]), the editor reports an error. The import still succeeds when the flow runs. - Select Refresh to reload the latest record from the steps before the import. Refreshing picks up changes made to those steps and discards your edits.
What the preview shows
| Part | Shows |
|---|---|
| Request | The request integrator.io will send, built from the sample record — the endpoint URL and the body; read-only. Select Headers to see the request headers. |
| Response | After Send, the response the destination returned. Select Headers to see the response headers. |
| Parsed output | The response after integrator.io processes it — success and error messages and any data the destination returned. This is the data response mapping works with; see Handle failed records in a flow. |
Switch between JSON and Tree to read a record as text or as an expandable structure.
You can resize the editor by dragging the handle between it and the canvas; see Preview export data.