replace_form_elements
Replace a Nettskjema form's full element list by sending the complete array; any omitted elements are deleted. Use to set all questions, headings, and page breaks at once.
Instructions
Replace the form's ENTIRE element list. Every element you leave out is DELETED.
This is not an "add an element" tool. Whatever you send becomes the form's
complete content: any question, heading, image or page break that is not in
elements is removed from the form. To add or change anything, call
get_form_elements first, modify the array it returns, and send all of it back
ā or call update_form_element, which does that read-modify-write for one
element. Sending a one-element list to a ten-element form deletes nine
elements.
Nothing locks the form in between: an edit made by someone else after your get_form_elements call is overwritten by this one without warning. The endpoint offers no version field, ETag or conditional header to detect that.
Each element is checked against the vendored ElementDTO schema before the request is sent: elementType is required on every element and must be one of the known types, and every field the schema declares is checked for type and range. A field the schema does not declare is passed through to the API rather than rejected here, so an element read back from a newer API than the vendored snapshot can still be written back unchanged.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| form_id | Yes | The form's numeric ID. | |
| elements | Yes | The complete list of elements the form should have, in order. Anything missing from this list is deleted. Keep each existing element's elementId so the API updates it instead of recreating it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |