Ask AI

Mapping Fields for Actions

Mapping the fields manipulated by the Action Button.

When setting up an Action Button such as an Add Record or Update Record, you need to specify which fields in your data source the button can manipulate. Thus, you need add all those field types and link them to corresponding fields in your data source.

You can add a new field using the Add field button in action button settings.

Note that computed fields will not appear in the list of mappable fields for the form.
Add field button
Add field button

Next, you need to select the field type and map it to the corresponding field in your data source.

You can also add a Label and Placeholder.

Mapping the field
Mapping the field

There is also a Required toggle, which, if enabled, makes it obligatory for the user to fill in the value for the given field when adding a new record or updating it.

Hidden Fields

Hidden field under Add Record action
Hidden field under Add Record action

Hidden fields let you collect data that’s not explicitly entered by the user (e.g. user profile data or a parameter from the page URL). Hidden fields are available on various actions such as Add Record or Update record.

The mapping for hidden fields works similar to other regular fields, so you simply need to select the field in your data source that’s going to receive the value. Now, let’s discuss the types of values you can collect through hidden fields. There are 4 categories, so let's examine them one by one.

1. Logged-in user

By default, here, you have the following options:

  • Email. Collects the email address of the logged-in user.
  • Name. Collects the name of the logged-in user.

2. URL Parameter

Using this option, you can collect any of the page’s URL parameters. Let's consider a specific example to see how that works. For instance, if you've created a job board with Softr, each job announcement will have a recordId (you can learn about Airtable Record IDs here, and learn how those work for Google Sheets here) in its page URL, indicating the data source record corresponding to that particular job. So, if you have an action button on the job announcement page, you can set a hidden field to collect the recordId to identify which job announcement the action has been submitted for.

Your page URL will look something like yoursite.com/job-details/senior-product-manager?recordId=rec7HcXAgKmlk8inf, so if you set your hidden field value as “recordId,” it will collect the value of recordId ("rec7HcXAgKmlk8inf" in this case).

3. Page URL

This parameter allows to get the full URL of the page the button has been submitted from.

4. Custom value

Here’ you can collect any custom value that you’re not able to collect using the previous options. For instance, you can use it to collect a custom text along with the submission. This can be useful if you have the same form on different pages and want to mark each of the forms distinctively.

Another important use case is collecting additional logged-in user parameters. If you've synced your users database with a data source, you can use this option to collect any of the field values corresponding to the user. Here, the value has the following format: {LOGGED_IN_USER:'field name'} ('field name' is replaced with the actual name of the field).

Let's say you have connected an Airtable data source and have a Status field in your users base as shown below.

Users base on Airtable
Users base on Airtable

So, if you set your hidden field's value as Status, the values of the Status field will be collected for each user submitting the form (e.g. for Elise it will be "Active").

Did this answer your question?
😞
😐
🤩

Last updated on May 18, 2023