Activity Fields are where you define data that will be collected at the time of integration configuration. They also define how data is mapped between actions and triggers. For an action to execute we need to send information and execute an endpoint in the third-party app, which can be identified through that app API documentation.
Suppose a user adds an integration, “When an appointment is added to Calendly, send a message to Basecamp”. From the “create a message endpoint” documentation, we know Basecamp requires the following to post a message
- Account info
- Project in that account
- Message Board of that project where the message will be posted
- Message body
We will collect these particulars through the activity fields. The method of setting up activity fields in both Actions and Triggers is the same. The image below shows the form that collects the metadata of the field.
The menu at the right top corner lets you define the type of the activity field, as shown below.
For now, we support the following field types:
- Drop-down: A field can be a drop-down menu. The data for the select field type is fetched from an external API, with the Dynamic Source Endpoint.
- Text-field: It takes simple plain text as input
- Checkbox: The field appears as a checkbox - the user will either check it or keep it unchecked
- Hidden: It does not appear to the user as they do not require input from the user. These come in handy in case of storing Webhook IDs, hard-coded values, etc.
- Fields List: These fields fetch custom fields from another API and display them to the user. For more details, click here.
- Radio: The field will be a radio button
- Date: The field will take in date as an input, it will display a date picker to the user
- Time: This will take time as an input, a time format (--:--:--) will be specified as placeholder
- TextArea: This is a text field, where a user can enter multiple line text
- Code Block: Output of the steps above the code block activity field will be available in the form of an array to this field. You can transform the output using this field.
Let us discuss the other components of the activity fields.
- Title: The title of the field that will appear in the template
- Machine Name: A machine name, that will be used in reference. Let's say if the title of the activity field is Message Board the corresponding machine name can be message_board.
- Description: A one-line description of what the field is about
- Parent Fields: A field can have one or more than one parent fields. A field is said to be a parent field when the value of another field depends on it.
- Child Field: A field can have one or multiple child fields. A field is said to be child field when it's value depends upon another field.
- Regular Expression to Validate Input Text: When you select the textfield or textarea type, an additional field appears.
Using this field you can specify the expression for the text input i.e. you can specify characters that can be accepted as input. The input provided by the user is validated against this expression.
Let us see an example of the parent-child field relationship.
As we are creating a message in a Basecamp Message Board. A Basecamp project can have multiple Message Boards. Similarly, a Basecamp account can have multiple projects. So, these follow a parent-child relationship, we will specify it in our activity fields as shown below.
The figure shows the parent-child relationship of the Project field. We use machine names in reference fields.
Since this is a drop-down field, so we can see a Data Source Endpoint option. This is where we specify if the projects will be fetched through an endpoint or will be hard coded. Configure your Dynamic Source endpoint.
Activity field configuration is the same in both triggers and actions. In actions, we send data to another app and in case of triggers, we receive data from other apps. The data is passed between triggers and actions using templates.
Mapping the Input Object Attributes against Activity Fields
When you select an Input Object for action, the attributes of that object need to be mapped against the activity fields.
For these activity fields, an additional drop-down field, Object Field appears as shown below.
The attributes of the object appear as a drop-down. You can select the attribute you want to map against this field. Let say you selected the Contact object, then the possible attributes will be First Name, Last Name, Email, etc.
When an activity field and an attribute are mapped, you do not need to manually map each field when you're creating templates. Learn more, here.
Hope you have configured your activity field by now.