Links

Transformation Writeback Webhook

In this section you will learn how to write back data leveraging the Server Side Validation Webhook.
Writeback provides the ability to programmatically "write back" data to individual fields, working as a part of Validation Webhooks when a validation endpoint has been configured. After writeback, no additional validation is performed on values that are returned from the validation endpoint; they are treated as the final source of truth since they come directly from the customer's own API. If there are type validation errors or other validation errors for that cell, writeback will override them.
Writeback output is mutually exclusive with validation output, i.e. one can't both provide a writeback value and mark a field as invalid. If a writeback value is returned, it is assumed that the provided replacement value is valid.
Transformation Writeback requires the configuration of a Validation Webhook, see Server Side Validation Webhooks for more details.

Writeback UI

When writeback takes place, users will see the cell marked in the UI with a blue border to indicate that it was modified by writeback. There is also a tooltip that provides users a more detailed message saying that the cell was modified by a validation webhook.

Writeback Server Requests

The value to be written back is optional and can be utilized for any field in the validation response by specifying a replacement field. When specifying a replacement value, you can optionally pass an infoMessage string to give users more information about why the original value was replaced. If no infoMessage is specified, then they will just see a generic message saying the field had a writeback applied to it.
This is the TypeScript type which corresponds to the expected response schema for validation webhooks:
type FieldValidationOutput =
| boolean
| {
isValid: boolean;
errorMessage?: string;
warningMessage?: string;
}
| {
replacement: string;
infoMessage?: string;
}
type RowValidationOutput = FieldValidationOutput[];
type ValidationResponse = RowValidationOutput[];
When returning a replacement to be written back, the three other fields (isValid, errorMessage and warningMessage) are not accepted, and the replacement string takes precedence.
Here's an example request that would be sent to a validation endpoint with two rows and two fields of data:
[
[
{ "fieldName": "name", "value": "Rotor" },
{ "fieldName": "description", "value": "Used to propel boats" }
],
[
{ "fieldName": "name", "value": "Magnet" },
{ "fieldName": "description", "value": "" }
]
]
And here's an example response to the request above which uses writeback to replace empty descriptions with the string "No description available":
[
[
{ "isValid": true },
true
],
[
{ "isValid": true },
{ "replacement": "No description available" }
]
]