Form Field Object

Use form fields to capture and store data related to leads, contacts, accounts, and other objects within the system. Learn more about forms in Salesforce Help.

The API to access the Form Field object follows the conventions described in Version 5 Overview.

Include the authentication header with every request. For information on how to authenticate, see Authentication.

Note

Supported Operations 

OperationHTTP VerbURL FormatAbility Requirements
CreatePOSThttps://pi.pardot.com/api/v5/objects/form-fieldsMarketing > Forms > Forms > Create
ReadGEThttps://pi.pardot.com/api/v5/objects/form-fields/<id>?<params>Marketing > Forms > Forms > View
QueryGEThttps://pi.pardot.com/api/v5/objects/form-fields?<params>Marketing > Forms > Forms > View
Add DependentPOSThttps://pi.pardot.com/api/v5/objects/form-fields/<id>/do/addDependentMarketing > Forms > Forms > Create
Add ProgressivePOSThttps://pi.pardot.com/api/v5/objects/form-fields/<id>/do/addProgressiveMarketing > Forms > Forms > Create
Add ValuePOSThttps://pi.pardot.com/api/v5/objects/form-fields/<id>/do/addValueMarketing > Forms > Forms > Create
Reorder Form Field ValuesPOSThttps://pi.pardot.com/api/v5/objects/form-fields/<id>/do/reorderFormFieldValuesMarketing > Forms > Forms > Create
Add TagPOSThttps://pi.pardot.com/api/v5/objects/form-fields/<id>/do/addTagMarketing > Forms > Forms > Create AND Marketing > Segmentation > Tags > Create
Remove TagPOSThttps://pi.pardot.com/api/v5/objects/form-fields/<id>/do/removeTagMarketing > Forms > Forms > Create AND Marketing > Segmentation > Tags > Create

Fields 

Required Editable Fields 

These fields are required only for the create operation.

FieldTypeDescription
formIdIntegerID of the Form the Form Field belongs to.
prospectApiFieldIdStringThe name of the Account Engagement prospect field that the form field is mapped to. On standard fields the value is the name of the field. For example, “firstName”. If mapping to a custom field, the value is the field name followed by __c. For example, the custom field “foodChoice” becomes “foodChoice__c”.
typeEnumData type of the object. See Form Field Type Enum below.
dataFormatEnumDefault ‘text’. Validation to apply to the input. See Form Field Data Format Enum below.

Optional Editable Fields 

FieldTypeDescription
labelStringLabel of the form field.
descriptionStringUser-assigned description for the field. This field isn’t queryable.
errorMessageStringError to display when the field isn’t submitted correctly.
cssClassesStringCSS class to apply to the paragraph element that wraps the form input and label.
isRequiredBooleanSet to true to make populating this field required for form submission. Default false.
isAlwaysDisplayBooleanSet to true to always display this field, even if a value has already been collected for the prospect. Default false.
isMaintainInitialValueBooleanSet to true to maintain the prospect field value of the initial form submission. Subsequent submissions with new values will be ignored. Default false.
isDoNotPrefillBooleanSet to true to prevent prospect data from being pre-filled into the field. Default false.
dependentsDependents []A collection of form field dependents.
progressivesProgressives []A collection of form field progressives.
valuesValues[]A collection of form field values. These are only availble for form fields of type checkbox, radio button, multi-select, and dropdown fields.

Read-Only Fields 

FieldTypeDescription
idIntegerID of the form field.
sortOrderIntegerEach field in a given form will be assigned a number that indicates the display order.
hasDependentsBooleanSet to true if this field has Dependents.
hasProgressivesBooleanSet to true if this field has Progressives.
hasValuesBooleanSet to true if this field has Values.
createdByIdIntegerID of the user who created this object.
updatedByIdIntegerID of the user who updated this object.
createdAtDateTimeCreation time of the object.
updatedAtDateTimeLast update time of the object.
createdByUserUser object representing the user who created this object.
updatedByUserUser object representing the user who last updated this object.

Required Values Fields 

Field NameData TypeDescription
values.valueStringA value for the form field.

Optional Values Fields 

Field NameData TypeDescription
values.labelStringThe label for a value on the form field.
values.listIdIntegerID of the list used for this value.
values.profileIdIntegerID of the profile used for this value.
values.sortOrderIntegerThe numeric value in which the value will be sorted on the form field.

Required Progressives Fields 

Field NameData TypeDescription
progressives.prospectApiFieldIdStringID of the prospect API field for Progressive Profiling. Required.

Required Dependents Fields 

Field NameData TypeDescription
dependents.formFieldIdIntegerThe ID of the form field to display when the dependent value is triggered.
dependents.valueStringThe value that triggers the dependent field to be displayed.

Form Field Create 

Create a single form field following the conventions described in the Version 5 Overview.

Example request:

1POST /api/v5/objects/form-fields HTTP/1.1
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4
5{
6    "formId": 10,
7    "prospectApiFieldId": "FirstName",
8    "label": "First Name",
9    "description": "Input the users first name.",
10    "errorMessage": "This field is required.",
11    "type": "text",
12    "dataFormat": "text",
13    "isRequired": true,
14    "isAlwaysDisplay": false,
15    "isMaintainInitialValue": false,
16    "isDoNotPrefill": false
17}

Example response:

201 Created

1{
2  "id": 79,
3  "createdAt": "2023-11-01T18:13:00-04:00",
4  "createdById": 7,
5  "cssClasses": null,
6  "dataFormat": "text",
7  "description": "Input the users first name.",
8  "errorMessage": "This field is required.",
9  "formId": 10,
10  "hasDependents": false,
11  "hasProgressives": false,
12  "hasValues": false,
13  "isAlwaysDisplay": false,
14  "isDoNotPrefill": false,
15  "isMaintainInitialValue": false,
16  "isRequired": true,
17  "label": "First Name",
18  "prospectApiFieldId": "firstName",
19  "sortOrder": 3,
20  "type": "text",
21  "updatedAt": "2023-11-01T18:13:00-04:00",
22  "updatedById": 7
23}

Form Field Read 

Retrieve a single form field object following the conventions described in the Version 5 Overview.

Example request:

1GET /api/v5/objects/form-fields/34?fields=id,formId,form.name,form.thankYouContent,form.campaignid,prospectApiFieldId,progressives.prospectApiFieldId,label,createdAt
2Host: pi.pardot.com
3Authorization: Bearer <access-token>

Example response:

1HTTP/1.1 200 OK
2Content-Type: application/json
3{
4    "id": 34,
5    "createdAt": "2023-07-17T17:25:48-04:00",
6    "form": {
7        "campaignId": 1,
8        "name": "Standard Form",
9        "thankYouContent": "<p>Thank you for filling out the form. We will get back to you shortly.</p>"
10    },
11    "formId": 1,
12    "label": "First Name",
13    "prospectApiFieldId": "firstName"
14    "progressives": [
15        {
16            "prospectApiFieldId": "email"
17        },
18        {
19            "prospectApiFieldId": "lastName"
20        }
21    ]
22}

Form Field Query 

Retrieving a collection of form fields follows the conventions described in Version 5 Overview.

Example request:

1GET /api/v5/objects/form-fields?fields=id,formId,sortOrder,prospectApiFieldId,label,type,dataFormat,createdAt,updatedAt
2Host: pi.pardot.com
3Authorization: Bearer <access-token>

Example response:

1HTTP/1.1 200 OK
2Content-Type: application/json
3{
4    "values": [
5        {
6            "id": 1,
7            "createdAt": "2023-07-17T17:25:48-04:00",
8            "dataFormat": "text",
9            "formId": 1,
10            "label": "First Name",
11            "prospectApiFieldId": "firstName",
12            "sortOrder": 1,
13            "type": "text",
14            "updatedAt": "2023-07-17T17:25:48-04:00"
15        }
16  ]
17}

Sortable Fields 

When executing a query, the following fields can be specified in the orderBy parameter. See the conventions for query described in the Version 5 Overview.

  • id
  • formId
  • createdAt
  • updatedAt

Filtering Results 

When executing a query, the following parameters can be used to filter the returned results. These parameters can be specified in the request along with any shared parameters defined in Version 5 Overview. When specifying more than one parameter, all parameters must match the record in order for it to be returned in the results.

ParameterDescription
idReturns any form field where id is equal to the given integer value.
idListReturns any form field where id is included in the given list of values.
idGreaterThanReturns any form field where id is greater than the specified value, non-inclusive.
idGreaterThanOrEqualToReturns any form field where id is greater than or equal to the specified value.
idLessThanReturns any form field where id is less than the specified value, non-inclusive.
idLessThanOrEqualToReturns any form field where id is less than or equal to the specified value.
formIdReturns any form field where formId is equal to the given integer value.
formIdListReturns any form field where formId is included in the given list of values.
formIdGreaterThanReturns any form field where formId is greater than the specified value, non-inclusive.
formIdGreaterThanOrEqualToReturns any form field where formId is greater than or equal to the specified value.
formIdLessThanReturns any form field where formId is less than the specified value, non-inclusive.
formIdLessThanOrEqualToReturns any form field where formId is less than or equal to the specified value.
createdAtReturns any form field where CreatedAt is equal to the given datetime value.
createdAtAfterReturns any form field where CreatedAt is after the given datetime value, non-inclusive.
createdAtAfterOrEqualToReturns any form field where CreatedAt is after or equal to the given datetime value.
createdAtBeforeReturns any form field where CreatedAt is before the given datetime value, non-inclusive.
createdAtBeforeOrEqualToReturns any form field where CreatedAt is before or equal to the given datetime value.
updatedAtReturns any form field where UpdatedAt is equal to the given datetime value.
updatedAtAfterReturns any form field where UpdatedAt is after the given datetime value, non-inclusive.
updatedAtAfterOrEqualToReturns any form field where UpdatedAt is after or equal to the given datetime value.
updatedAtBeforeReturns any form field where UpdatedAt is before the given datetime value, non-inclusive.
updatedAtBeforeOrEqualToReturns any form field where UpdatedAt is before or equal to the given datetime value.

Example request:

1GET /api/v5/objects/form-fields?fields=id,label&orderBy=id desc&idGreaterThan=3&idLessThan=7
2Host: pi.pardot.com
3Authorization: Bearer <access-token>

Example response:

1HTTP/1.1 200 OK
2Content-Type: application/json
3{
4    "values": [
5        {
6            "id": 6,
7            "label": "Product Name"
8        },
9        {
10            "id": 5,
11            "label": "Product MSRP"
12        },
13        {
14            "id": 4,
15            "label": "Company"
16        }
17    ]
18}

Add Form Field Dependents 

Adds a dependent to the form field. Used to display other fields on the form based on the value of this field.

Example: Conditionally display a State field when a prospect indicates their Country is United States.

Tip: Use conditional display to lead a prospect through the process of filling out a longer form with multiple fields, especially when certain fields are related or only relevant if a certain value is chosen.

Note

Example request

1POST `https://pi.pardot.com/api/v5/objects/form-fields/78/do/addDependent`
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4Content-Type: application/json
5
6{
7    "formFieldId": 80,
8    "value": "departments"
9}

Example Response

1HTTP/1.1 200 OK
2Content-Type: application/json
3{
4    "id": 3,
5    "formFieldId": 80,
6    "value": "departments"
7}

Add Form Field Progressive 

Adds a progressive profiling field to a form field. This form field will only be displayed if the prospect already has data in the prospect api field of this progressive.

Example: The first time a prospect visits, only ask for their first name, last name, and email. Then use progressive profiling to ask for their company and phone number on the next form.

Use progressive profiling to collect more data over a series of multiple form submissions. By spreading out your information gathering over multiple interactions, the prospect is more likely to convert each time and you still get the data you need.

Note

Example request

1POST `https://pi.pardot.com/api/v5/objects/form-fields/79/do/addProgressive`
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4Content-Type: application/json
5
6{
7  "prospectApiFieldId": "FirstName"
8}

Example Response

1HTTP/1.1 200 OK
2Content-Type: application/json
3{
4    "id": 4,
5    "prospectApiFieldId": "firstName"
6}

Add Form Field Value 

Add a possible value for the form field. These values can only be added when the form field is of type checkbox, radio button, multi-select, or dropdown.

Example Request

1POST `https://pi.pardot.com/api/v5/objects/form-fields/80/do/addValue`
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4Content-Type: application/json
5
6{
7  "value": "HR Department",
8  "label": "Human Resources Department"
9}

Example Response

1HTTP/1.1 200 OK
2Content-Type: application/json
3{
4    "id": 4,
5    "label": "Human Resources Department",
6    "listId": null,
7    "profileId": null,
8    "value": "HR Department"
9}

Reorder Form Field Values 

Reorder a list of form field values for a given form field. When this action is taken the new order of values can be seen on the form field.

Example Request

1POST `https://pi.pardot.com/api/v5/objects/form-fields/80/do/reorderFormFieldValues`
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4Content-Type: application/json
5
6{
7    "formFieldValueIds": [5,4,3,2,1]
8}

Example Response

1HTTP/1.1 204 No Content

Add Tag 

Adds a Tag to the Form Field object, which creates a TaggedObject.

Example Request

1POST https://pi.pardot.com/api/v5/objects/form-fields/1000/do/addTag
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4Content-Type: application/json
5
6{
7    "tagId": 100
8}

Example Response

1HTTP/1.1 200 OK
2Content-Type: application/json
3{
4    "id": 610,
5    "createdAt": "2024-09-23T18:26:49-04:00",
6    "createdById": 250,
7    "objectId": 1000,
8    "objectType": "form-field",
9    "tagId": 100
10}

Remove Tag 

Remove a tag from a Form Field object. When you remove a tag, the associated TaggedObject record is deleted.

Example Request

1POST https://pi.pardot.com/api/v5/objects/form-fields/1000/do/removeTag
2Host: pi.pardot.com
3Authorization: Bearer <access-token>
4Content-Type: application/json
5
6{
7    "tagId": 100
8}

Example Response

Returns code 204 no content.

Enums 

Type 

  • text
  • radio button
  • checkbox
  • dropdown
  • textarea
  • hidden
  • date
  • multi-select

Data Format 

  • text
  • number
  • email
  • email with valid mail server
  • email not from isps and free email providers