capabilities.work

Safe Form Edit with Write Control

A 3-step recipe with Google Forms. We can help you get access.

Recipe · 3 steps

Safe Form Edit with Write Control

Edit a form without clobbering a concurrent writer, using revision-guarded write control.

  1. Read the form to capture the revision id the edit will be based on, along with the current items so the caller can confirm itemIndex points at the item they mean to change.
  2. Apply the title change and the item change in one batch update, declaring the revision read above as required. The service rejects the batch if the form has moved on, which is the concurrency guarantee this flow exists for.
  3. Read the form back to confirm the applied title and to capture the new revision id to carry into the next edit.
What you'll need to have ready
  • formId: The id of the form to edit.
  • newTitle: The new title to apply to the form.
  • itemIndex: The zero-based index of the existing item to update.
  • itemTitle: The new title for the item at itemIndex.
  • itemRequired: Whether the question at itemIndex must be answered.
For your developer

Arazzo workflow google-forms:safe-form-edit, 3 operations: getForm → batchUpdateForm → getForm. Specs on APIs.io.