How to Translate Records in Airtable using AI

Nov 8, 2023Andy Cloke

In this simple tutorial, we'll translate a list of book descriptions from English to Spanish in Airtable. You can use the same approach to translate any records in Airtable from one language to another.

We'll use the Data Fetcher Airtable extension and its OpenAI integration to translate the Airtable records with no-code.

Set Up Airtable Base

For this example, we have a list of books with their titles in the "Name" field and descriptions (in English!) in the "Description" field. We're going to translate the text in the "Description" field, but you can use the same approach for whatever data you have in your Airtable base.

Books Table with Names And Descriptions.png

Add a long text field called "Description (Spanish)".

Description (Spanish) field.png

Add a formula field called "Prompt" with the following formula:

CONCATENATE("user:Translate the following book description from English to Spanish. Do not change the meaning: ",Description)

If you want to use a different language, replace "Spanish" in the formula with your chosen language. If your field to be translated is called something other than "Description", replace "Description" with the field name.

prompt field.png

Finally, we need to create a new view which contains only records that need to be translated. Create a new grid view called "Needs translation" with the following filters:

  • "Description" is not empty
  • "Description (Spanish)" is empty
needs translation view.png

Add Data Fetcher Extension

Add Data Fetcher to your Airtable base via the Airtable marketplace. Sign up for a Data Fetcher account by entering a password and clicking "Sign up for free" or sign in with Google. If you already have a Data Fetcher account, use the "Have an account?" in the bottom left and sign in.

Data Fetcher is a powerful Airtable extension that can be used to import different types of data from APIs or websites into Airtable.

Data Fetcher Sign Up

Translate Records in Airtable with No-Code

Data Fetcher requests enable you to import data into your Airtable base. Click "Create your first request" on the home screen of the Data Fetcher extension to begin.

Create your first request in Data Fetcher

For Application, select "OpenAI".

Generate Company Descriptions with GPT3

Sign up for a free OpenAI here and generate an OpenAI API key here. (You'll need an API key from OpenAI to translate records in Airtable.)

With every new OpenAI account, you receive $5 worth of credit. This is enough for this tutorial. But if you plan to use OpenAI once this has run out, you will need to upgrade your OpenAI account for more credit.

For Authorization, copy and paste your OpenAI API key.

Generate Company Descriptions with GPT3

For Endpoint choose 'Create chat message completion'.

ChatGPT-Airtable-Integration5.jpg

Give your request a name such as "Translate records" and click "Save and Continue.".

translate records save and continue.png

Under Messages, copy the following message and click "Enter".

system:you are an expert translator
you are an expert translator.png

Then we're going to add a reference to our "Prompt" Airtable field. Click the "+" icon on the right-hand side of the input to open the table reference menu.

  • The Table should be "Books" or whatever your table is called.
  • The Field should be "Prompt".
  • The Run for every record in view should be "Needs translation".

Double check all of those settings are correct, then click "Confirm".

translate prompt field reference.png

Your Messages field will now have a reference to the "Prompt" Airtable field.

translate messages field.png

Click "Save & Run" in the bottom right of the screen.

save and run translate records.png

The Response field mapping modal will now open. Set the "Message" response field to map to the "Description (Spanish)" field in your output table, then click "Save & Run".

translate response field mapping.png

The request will translate every Airtable record in the "Needs translation" view from English to Spanish.

translated airtable records.png

Whenever you have new records in this view, you can open Data Fetcher and click "Run" to run the request and translate the new Airtable records.

Automatically Translate Records in Airtable

To set up automatic translations, you can use Data Fetcher's Trigger feature.

Triggers automatically run a request whenever a change happens in the Airtable base. For example, when a new record is created in the "Needs translation" view.

Triggers are a paid Data Fetcher feature, so you'll first need to upgrade your account. Scroll to the Schedule / Trigger / Webhook URL tabs and click on the Upgrade button underneath.

upgrade.jpg

Select a plan to suit you and enter your payment details.

data fetcher upgrade pricing plans.png

In Data Fetcher, click "I've done this".

Schedule Data Fetcher

Next, select the Trigger tab and underneath, click "+ Authorize".

Authorize.jpg

Accept the prompt "I understand, let's Authorize".

Authorize2.jpg

Click "+ Add a base".

Authorize3.jpg

By selecting "All current and future bases in all current and future workspaces", we'll avoid the need to re-authorize access for individual bases in the future.

Click on "Grant access".

Authorize4.jpg

Back in Data Fetcher, ensure the Trigger tab is selected. For this tutorial, we'll use the trigger type of "Record created". Also select the "Books" table and the "Needs translation" view.

Finally, click "Save". The request will now run automatically whenever a record is created in the "Needs translation" view and translate the Airtable record from English to Spanish.

translate trigger.png

Related Posts

Use the OpenAI Assistants API in Airtable with No-Code

Use the OpenAI Assistants API in Airtable with No-Code

Jan 5, 2024

Rosie Threlfall

OpenAI
How to Use AI in Airtable (2023)

How to Use AI in Airtable (2023)

Sep 15, 2023

Rosie Threlfall

OpenAI