Skip to main content

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.

ruleThe value
not_textwas no text or number, for a text field.
too_longis longer than the field's length limit.
not_an_optionis none of the field's options: a dropdown, list box, radio group or check box takes one of them.
not_a_booleanwas true for a check box with several on-values, which takes one of its options instead.
several_valueswas a list for a list box that takes one choice.
not_fillablewas given to a signature field or a button, which take none.
no_fonthas 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/info lists the export values as options.
  • A text longer than the field allows, which a viewer would have stopped while typing.

How to fix it​

  • Read the field's type, options and limits with /pdf/info and send a value of that kind.
  • Send strict: false to leave values that do not fit out: the render's form.skipped lists their fields with the reason invalid.
  • For no_font, fill without flatten: 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.