Working with Project Forms
Basic functionality guide to working with forms on a project.
Intro
Fieldwire 'Forms' is a premium module that allows users with Business and above subscriptions to replace paper forms with digital versions that are fast to create and distribute, easy to fill out in the field on our mobile apps, and housed permanently in a searchable Fieldwire database for improved accountability.
This guide aims to provide some how to steps for some of the most common functions when dealing with forms via the API. This will guide will not go into the structure of the form as more info can be found on the Getting Form Data page.
Prerequisite Steps
Before following any of the steps below a project must contain a form template.
Creating a form from a template
When creating a form there are two steps that need to take place:
- Create the form record container
- Use a form template to generate a form
Creating the form record
The form record
serves as the top-most record for the form. To create the form record make a POST call with the following endpoint Create a new form kicks off required sidekiq workers. The minimum body that is needed to create a form is shown below.
{
"creator_user_id": <user_id>,
"last_editor_user_id": <user_id>,
"owner_user_id": <user_id>,
"form_template_id": "<form_template_id>",
"checksum": "<form_template_checksum>",
"name": "<name>"
}
Note: The owner_user_id is the same thing as the form assignee.
The inputs for the request above can be found via the following API calls.
user_id
- Show all projects users for an account - This endpoint can be used to list the available users for a project. Use theid
field for the desired user in the request when creating the form.name
- This is the name assigned to the form.form_template_id
- Get all form_templates in project - This endpoint will list the available form templates for a project. Use theid
field for the desired form template in the request when creating the form.checksum
- Get all form_templates in project - This endpoint will list the available form templates for a project. Use thechecksum
field for the desired form template in the request when creating the form.
Generating the form
The previous POST call will return an id
. Use this ID and the form template id to trigger the generation of the form with a POST call to Generate a new form. Once the form is generated, the Getting Form Data gives you more information on how to interact with the full form response.
Updated over 1 year ago