form_value_invalid
HTTP 422 · code: "form_value_invalid" · type: https://docs.formfeed.dev/errors/form-value-invalid
/pdf/fill gave a field a value it does not take. The call was strict, which is the default, so nothing was filled and nothing was charged. field names the field and rule says what the value broke; the value itself is never repeated, since a problem lands in logs and webhook events.
rule | The value |
|---|---|
not_text | was no text or number, for a text field. |
too_long | is longer than the field's length limit. |
not_an_option | is none of the field's options: a dropdown, list box, radio group or check box takes one of them. |
not_a_boolean | was true for a check box with several on-values, which takes one of its options instead. |
several_values | was a list for a list box that takes one choice. |
not_fillable | was given to a signature field or a button, which take none. |
no_font | has characters no font of the PDF tools has, when flatten draws it into the page. |
Example
{
"type": "https://docs.formfeed.dev/errors/form-value-invalid",
"title": "Invalid form value",
"status": 422,
"detail": "The value for \"size\" does not fit the field (not an option)",
"code": "form_value_invalid",
"field": "size",
"rule": "not_an_option",
"render_id": "rnd_0d290c45cbeb4554b946bbad1acee87e",
"request_id": "req_4b7c1e9a2f3d4c5b8a6e7f9012"
}
Common causes
- A choice given by what it shows rather than by its export value, which is what a form stores:
/pdf/infolists the export values asoptions. - A text longer than the field allows, which a viewer would have stopped while typing.
How to fix it
- Read the field's
type,optionsand limits with/pdf/infoand send a value of that kind. - Send
strict: falseto leave values that do not fit out: the render'sform.skippedlists their fields with the reasoninvalid. - For
no_font, fill withoutflatten: the value is set in the field, and the viewer draws it with its own fonts.
Retry?
Not with the same request: the field still does not take that value.