Getting started

  • Design forms
  • Share forms
  • Manage users
  • Collect form data
  • Configure notifications
  • Handle form data in Power Automate
  • Handle form data in Make
  • Handle form data in Zapier
  • Handle form data in n8n
  • Handle form data with REST API
  • Connect to Airtable
  • Connect to SharePoint

User guide

  • Toolbar
  • Settings
  • Containers
  • Controls
  • Fields
  • SharePoint fields
  • Airtable fields
    • Single line text
    • Long text
    • Email
    • URL
    • Phone number
    • Number
    • Currency
    • Percent
    • Date
    • Checkbox
    • Single select
    • Multiple select
    • Barcode
    • Rating
    • Attachment
    • Link to another record
    • Autonumber
    • Count
    • Created by
    • Created time
    • Formula
    • Last modified by
    • Last modified time
    • Lookup
    • Rollup
    • User
  • Themes
  • Validation
  • JavaScript

General

  • YouTube
  • Licensing
  • Manage subscription
  • Billing and payments
  • Privacy policy
  • Data protection and security
  • Version history

Integrations

  • Save and share
  • Document generation
  • Collaboration
  • CRM
  • Social Networks

Multilingual support

  • Adapt public web forms to right-to-left languages

Provisioning public forms with NuGet package

  • Create and provision web forms programmatically
  • Create a contact web form in Visual Studio
Documentation › Airtable field types in Forms › Link to another record

icon Link to another record

Use the Link to another record field to pick one or multiple of the entries from a different Airtable table.

This page contains a detailed description of the field properties and JavaScript samples which you can use with this field.

Link to another record field

  • Common properties

  • Link to another record properties

    • Display field

    • Operator

    • Order by

    • Order type

    • Extra fields

  • JavaScript framework

    • Wait until field is ready

    • Get record IDs

    • Get record fields

    • Refresh the field

    • Handle change event

    • Make field required

    • Disable field

    • Get HTML element

    • Hide field

    • Operator

    • Order by

    • Order type

    • Filter available records

Common properties

Airtable Field:

  • Name

  • Title

  • Type

General:

  • Title

  • Layout

  • Read-only

  • Required

  • Hint

  • Description

  • Class

  • Style

Rules:

  • Hide

  • Disable

Title:

  • Width

  • Font

  • Wrap

Control:

  • Width

  • Font

Link to another record properties

Here you can find properties related to the Link to another record field.

Display field

Configure which of the target table’s fields to show in the dropdown.

Display field property

Operator

Define how the field handles the search:

  • StartsWith—only show items that start with the entered value.

  • Contains—show all items that contain the entered value.

Operator property

Order by

Select a field to sort the available options by.

Order by property

Order type

Choose the sorting order: ascending or descending.

Order type property

Extra fields

By default, only the item ID and the displayed field are retrieved. The Extra fields property allows you to retrieve additional fields.

Specify which fields should also be returned from the source table:

Extra fields property

JavaScript framework

In this section, you can find basic examples of how to work with the field using JavaScript.

For more examples, check out Working with form fields in JavaScript article. If you are not familiar with the JavaScript framework, get started with the JavaScript basics.

Note

The field is only accessible once the form is rendered, so all calls to the field must be inside fd.rendered event:

fd.rendered(() => {
    // access the field's value and print in the browser's console
    console.log(fd.field('Field1').value);
});

Wait until field is ready

Wait until the field is loaded. The ready method returns a promise that is resolved when the field is fully initialized.

fd.field('Field1').ready(field => {
    // alert when the field is ready
    alert('Field is fully loaded');
});
// or
fd.field('Field1').ready().then(field => {
    // alert when the field is ready
    alert('Field is fully loaded');
});

Get record IDs

Get the record ID or an array of record IDs if the Airtable field allows linking several records:

fd.field('Field1').value;

Get record fields

You can get the values of the Display field and fields selected in Extra fields:

  1. In Airtable, open the linked table, right click on the field name and select Copy field URL:

    Context dialog for the table field in Airtable
  2. Save the last path segment from the copied URL—this is the field ID. For example, in the following URL fldHOMwG086a2mdNb is the field ID:

    https://airtable.com/app1hG3lcIxM3WHoR/tblmNBOO1jyPmgcg5/viw9dHmNROet5iu8s/fldHOMwG086a2mdNb
    
  1. Get the record’s field value in JavaScript.

    • Get the selected record for the Link to another record field that allows linking only to a single record:

      // replace Field1 with the form field's name
      
      const recordData = fd.field('Field1').widget.dataItem(); // get the selected record
      console.log(recordData.fldHOMwG086a2mdNb); // use the field ID from the previous step
      
    • Get selected records for the Link to another record field that allows linking to multiple records:

      // replace Field1 with the form field's name
      
      const records = fd.field('Field1').widget.dataItems(); // get selected records
      for (const recordData of records) {
         console.log(recordData.fldHOMwG086a2mdNb); // use the field ID from the previous step
      }
      

Refresh the field

Refresh connection with the source table.

If any items were changed in the source table, the data presented in the Link to another record field will be updated.

fd.field('Field1').refresh();

Handle change event

Execute a function when a field value has been changed:

fd.field('Field1').$on('change', value => {
    // log changes to browser's console
    console.log('New value: ' + value);
});

Make field required

Make a field required or optional:

// make field required
fd.field('Field1').required = true;

// make field not required
fd.field('Field1').required = false;

Disable field

Make a field non-editable. The field value can still be changed with JavaScript and saved:

// disabled field
fd.field('Field1').disabled = true;

// enable field
fd.field('Field1').disabled = false;

Get HTML element

Access HTML element inside the field in order to modify it, hide it, or do something else.

// access field's control
let htmlField = fd.field('Field1').$el;

// access field's block, which includes title and control
let htmlFullField = fd.field('Field1').$parent.$el;

Hide field

Hide a field from a user. The field value can still be accessed and changed with JavaScript:

// hide field
fd.field('Field1').hidden = true;

// show field
fd.field('Field1').hidden = false;

Operator

Programmatically define how the field handles the search:

  • StartsWith—only show items that start with the entered value.

  • Contains—show all items that contain the entered value.

fd.field('Field1').operator = 'startsWith';
fd.field('Field1').operator = 'contains';

Order by

Choose the linked table field to use for ordering records in the dropdown:

fd.field('Field1').orderBy = 'Name';

// refresh the field to update the ordering
fd.field('Field1').refresh();

Order type

Choose how to order records in the dropdown:

// sort records in descending order
fd.field('Field1').orderType = 'desc';

// sort records in ascending order
fd.field('Field1').orderType = 'asc';

// refresh the field to update the ordering
fd.field('Field1').refresh();

Filter available records

You can filter the records available for selection:

  1. In Airtable, open the linked table, right click on the field name and select Copy field URL:

    Context dialog for the table field in Airtable
  2. Save the last path segment from the copied URL—this is the field ID. For example, in the following URL fldHOMwG086a2mdNb is the field ID:

    https://airtable.com/app1hG3lcIxM3WHoR/tblmNBOO1jyPmgcg5/viw9dHmNROet5iu8s/fldHOMwG086a2mdNb
    
  1. Define the Airtable formula to use for filtering:

    // replace Field1 with the form field's name
    
    fd.field('Field1').formula = () => {
       return 'fldHOMwG086a2mdNb < 100'; // Use the field ID from the previous step
    };
    
    // refresh the field to update the filtering
    fd.field('Field1').refresh();
    

Filtering supports logic beyonds simple comparisons. Here is an example that uses FIND() to filter out all entries that don’t include the combination of symbols from the nameField:

fd.rendered(() => {
   const nameField = fd.field('Name'); // get the common name field
   const linkedRecordField = fd.field('Field1'); // get the linked record field

   const airtableColumnName = 'fldHOMwG086a2mdNb'; // save the Airtable column name in a variable

   nameField.$on('change', linkedRecordField.refresh); // refresh the linked record field whenever the name field is updated

   linkedRecordField.formula = () => {
      const name = nameField.value;

      if (name !== null && name.length > 0) return `FIND("${name}", ${airtableColumnName}) != 0`; // return the filtering criteria for the name
      else return ''; // if the name field is empty, don't apply the filter
   };
});

Visit the Airtable documentation article for an in-depth reference to Airtable formulas, or check our article for more examples: How to filter linked record fields in Airtable forms.