My Developer Account

FormFieldCondition

A rule that conditionally shows a form field based on the answer given to another (trigger) field.

A condition belongs to the form_field it shows, and points at a trigger_form_field whose answer determines whether that field is displayed. A form field can have at most one condition. The trigger is matched in one of two ways:

  • trigger_form_field_option — the condition is met when the answer to the trigger field is this option (used for option-based fields such as dropdowns, gender, campus, etc.).
  • trigger_form_field_option_value — the condition is met when the answer to the trigger field equals this string (used for boolean custom fields).

When neither is set, the condition is met whenever the trigger field has any answer.

Conditions are created, updated, and destroyed under the form field they belong to (POST/PATCH/DELETE .../fields/{id}/form_field_conditions). The form_field and trigger_form_field must both belong to the same form, and the trigger_form_field_option must belong to the trigger_form_field. Writing requires permission to manage the form.

Example Request

curl https://api.planningcenteronline.com/people/v2/forms/{form_id}/fields/{field_id}/form_field_conditions

View in API Explorer →

Example Object

{
  "type": "FormFieldCondition",
  "id": "1",
  "attributes": {
    "created_at": "2000-01-01T12:00:00Z",
    "trigger_form_field_option_value": "string",
    "updated_at": "2000-01-01T12:00:00Z"
  },
  "relationships": {
    "form_field": {
      "data": {
        "type": "FormField",
        "id": "1"
      }
    },
    "trigger_form_field": {
      "data": {
        "type": "FormField",
        "id": "1"
      }
    },
    "trigger_form_field_option": {
      "data": {
        "type": "FormFieldOption",
        "id": "1"
      }
    }
  }
}

Attributes

Name Type Description
created_at date_time
id primary_key
trigger_form_field_option_value string

Set when the condition is triggered by a specific text value (e.g. a boolean custom field) instead of a trigger_form_field_option.

updated_at date_time

Relationships

Name Type Association Type Note
form_field FormField to_one

The field that is shown when the condition is met.

trigger_form_field FormField to_one

The field whose answer is evaluated to determine whether the condition is met.

trigger_form_field_option FormFieldOption to_one

The option of the trigger field that meets the condition, when the trigger is an option rather than a value.

Order By

Parameter Value Type Description
order created_at string

prefix with a hyphen (-created_at) to reverse the order

order updated_at string

prefix with a hyphen (-updated_at) to reverse the order

Query By

Name Parameter Type Description Example
created_at where[created_at] date_time

Query on a specific created_at

?where[created_at]=2000-01-01T12:00:00Z
updated_at where[updated_at] date_time

Query on a specific updated_at

?where[updated_at]=2000-01-01T12:00:00Z

Pagination

Name Parameter Type Description
per_page per_page integer

how many records to return per page (min=1, max=100, default=25)

offset offset integer

get results from given offset

Endpoints

Listing

HTTP Method Endpoint
GET /people/v2/forms/{form_id}/fields/{field_id}/form_field_conditions

Reading

HTTP Method Endpoint
GET /people/v2/forms/{form_id}/fields/{field_id}/form_field_conditions/{id}

Creating

HTTP Method Endpoint Assignable Attributes
POST /people/v2/forms/{form_id}/fields/{form_field_id}/form_field_conditions
  • form_field_id
  • trigger_form_field_id
  • trigger_form_field_option_id
  • trigger_form_field_option_value

Updating

HTTP Method Endpoint Assignable Attributes
PATCH /people/v2/forms/{form_id}/fields/{field_id}/form_field_conditions/{id}
  • form_field_id
  • trigger_form_field_id
  • trigger_form_field_option_id
  • trigger_form_field_option_value

Deleting

HTTP Method Endpoint
DELETE /people/v2/forms/{form_id}/fields/{field_id}/form_field_conditions/{id}

Belongs To

HTTP Method Endpoint Association Details Filter By
GET https://api.planningcenteronline.com/people/v2/forms/{form_id}/fields/{form_field_id}/form_field_conditions FormField