Replies: 1 comment 1 reply
|
@ali-fetty use ?include=fields param to add fields[] array with uuids and values to the response |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
Each entry in the
valuesarray is identified only by the field name:{ "field": "Full Name", "value": "John Doe" }The
fieldname isn't a reliable unique key: a submission can span multiple documents that reuse the same field names (Signature,Date, etc.), and names can also be blank, duplicated, or renamed. There's no way to map a value back to a specific field. (Related: #431 — a user makes separate/templates/:idcalls just to get field uuids.)Proposal
Add the field
uuidto eachvaluesentry:{ "field": "Full Name", "uuid": "a1b2c3d4-...", "value": "John Doe" }Why not the
fieldsarray? It has the uuid, butvaluesis the array most integrations consume (and the one in the API/webhook docs). Addinguuidinline avoids joining a second array on a non-unique name. The uuid is unique per field and stable across every submission of a template — a dependable key.Notes
fieldandvalue.build_values_array(lib/submitters/serialize_for_webhook.rb), which feeds both the webhook and REST API:openapi.yml(values.items, both definitions) to match — the current{ field, value }shape was locked in via Incorrect typing on 'values' property of create submission response in openapi.yaml #399.Happy to open a PR (serializer + spec + OpenAPI) if maintainers are open to it.
All reactions