Batch Create Object

Create several new objects of the same type in your Procore account.

This action executes the same Procore API calls as the Create Object action, which is to say APIs that use an HTTP POST request and take a single object (rather than an array of objects) as input. The action calls the specified Procore API multiple types to create multiple objects in Procore.

Inputs

KeyValue
apiPathRequiredThe Procore API endpoint that you wish to invoke, without the "vapid" prefix. Please refer to the Procore Actions overview for more on the apiPath input, which is required for all Procore Actions.
dataSetUrlRequiredThe URL of the DataSet file containing the objects that you want to create. Each DataSet row represents a Procore object that you want to create, while each column is a field within that object.
field_<fieldname>Required (at least one)The name of the Procore field represented by the field called fieldname. These inputs are used to map the DataSet column names to the field names expected by the Procore API. Your DataSet may contain many columns, but only the columns mapped in this way will be sent to Procore.

For instance, suppose your DataSet has a column called "FirstName", and the Procore API expects a field called user.first_name. Then you would add an input called field_user.first_name, and set its value to FirstName.

Refer to the Body Parameters section of your Procore API documentation for a list of valid field names.
fieldType_<fieldname>OptionalThe data type of the field called fieldname. The accepted values are date, datetime, boolean, text, number, and integer. Specifying this for a field will format the values in field_<fieldname> in a way that Procore will accept. This is only necessary for date and boolean fields; it can be skipped for other field types.

Refer to the Body Parameters section of your Procore API's documentation to determine the correct field type for a given field.

Outputs

None

Usage Examples

Suppose you have a form that needs to make some updates to a Procore project. The project ID is contained in a form field called "ProjectId", and one of the things you want to do when the form is completed is add users to the project in Procore. You have the user information stored in a GoFormz DataSource, and the relevant DataSource column names are FirstName, LastName, Title and IsEmployee.

You might start this workflow with a Form Completed trigger, then follow it up with the Get Data Source action to extract the user data. Let's say you call this step "GetProjectUsers".

Finally, you would create the Batch Create Object step, which will create these users in the Procore project. Your Batch Create Object inputs will be as follows:

KeyValue
apiPath/projects/#{trigger.ProjectId}/users
dataSetUrl#{GetProjectUsers.dataSetUrl}
field_user.first_nameFirstName
field_user.last_nameLastName
field_user.job_titleTitle
field_user.is_employeeIsEmployee
fieldType_user.is_employeeboolean

First, we construct the apiPath as described in Procore's Create Project User API documentation, using the "ProjectId" field from the completed form to fill in the required project ID path parameter.

Next, we get the DataSet file from the GetProjectUsers step and map its columns to the corresponding fields in the API's Body Parametersfirst_name, last_name, job_title and is_employee. Finally we set the type of the IsEmployee column to boolean, to make sure that it is formatted correctly when it is sent to Procore.