Kuovonne's Extensions & Scripts
Share
Explore
Extensions

icon picker
Prefilled Forms

Prefilled forms can save time and improve accuracy, but manually building the URLs for prefilled forms can be tedious and subject to typos. This extension creates a formula that you can place in that table to generate a unique prefilled URL for each record using the values in that record.
The extension detects the field names for your form and the field names in the table containing values. The resulting formula also encodes any special characters that cannot appear in a URL, such as spaces.
The extension can also create a formula that prefills forms with static text or the value of another formula.

Getting the extension

You can get the extension in the .

Use cases

Use case 1: Create prefilled links for clients You already have a table of client information, and you have an onboarding form, questionnaire, evaluation survey or other form for them to fill out. You want a to email each client a link to the form prefilled with the client’s name and other details. Use the extension to build the formula to for each client.
Use case 2: Click a button to create records with defaults New records tend to have several fields that always have the same combination of values. For each combination, use a button field with the url for the form prefilled with that combination. Click the button to launch the prefilled form and have less to fill out.

Ways of prefilling fields

You can prefill fields with a field value, static text, or a formula field.
Use a field value to include a value specific to a record, such as a name.
Use static text to set a default value.
Use a formula to compute a value that can vary, but does not exist as a field.
You can also decide if you want to prefill based on field name or field ID.

Special situations

Prefilling date fields

If you are prefilling a date field, the Airtable form may show a date one day off from the actual date in the record. This is due to a combination of how Airtable stores dates, how Airtable forms interpret dates, and your local time zone.
To avoid this issue, use the following formula to convert your date field to a date string that does not include a time:
IF({Date},DATESTR({Date}))
In the extension, choose to prefill the date field with a formula instead of a field value. Then enter the formula, replacing {Date} with the name of your date field in both places.

Emailing the prefilled links with automations

If you are using Airtable automations to email the url, you may need to escape the underscore character or the Airtable automations will think that you are trying to include italic text. Whether or not you need to escape the underscore character is highly dependent on how you create your email message, so always test your email template.
If your url needs escaping, create a second formula field that escapes the underscores, then use the escaped url in the automation email:
SUBSTITUTE({Original Url}, "_", "\_")

Prefilling linked records

There are two ways to prefill a linked record field
Primary field value. Originally this was the only method available. However, there can be problems when primary field values have commas, quotes or other special characters. Prefilling by primary field value also does not work if the value is not 100% unique in the linked table. These prefills can also break if the primary field value changes.
Record ID. This is the recommended method. It works regardless of the primary field value, and regardless of the number of linked records.
If you want to prefill a linked record with the record containing the formula result, prefill the form with a formula result, using the formula RECORD_ID().
If you want to prefill a linked record with the same records that are linked to the record containing the formula results, you must prefill the form form a rollup field of record IDs.
In the linked table, create a formula field with the formula RECORD_ID().
In the table that contains the formula for the prefilled form, create a rollup of the record ID with the formula ARRAYJOIN(values, ","). Use this rollup result in the formula for the prefilled form.

Changing or duplicating the base

If you change field names, update the formula for the new field names. If you prefill by field ID, you do not technically need to update the formula, but it will make understanding and maintaining the formula easier in the future if you do.
If you duplicating the base, the duplicate base will have a new shared url for the form, but the formula will still be using the shared url for the form in the original base. Update the formula to use the new shared url. If you prefilled via field ID, you will also need to update all of the field IDs.

Other notes

If you use a formula value in a prefilled form, the link will use the value of the formula at execution time. If you use a button field, it will be the value of the formula when you click the button. If you use a formula field to calculate a url and then put that url in an email, it will be the value when the url was inserted in the email, not the time when the link is clicked. For example, the formula DATESTR(TODAY()) will work well in a button field, but not in an emailed link.

Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.