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.
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.
Add a long text field called "Description (Spanish)".
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.
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:
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 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.
For Application, select "OpenAI".
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.
For Endpoint choose 'Create chat message completion'.
Give your request a name such as "Translate records" and click "Save and Continue.".
Under Messages, copy the following message and click "Enter".
system:you are an expert translator
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.
Double check all of those settings are correct, then click "Confirm".
Your Messages field will now have a reference to the "Prompt" Airtable field.
Click "Save & Run" in the bottom right of the screen.
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".
The request will translate every Airtable record in the "Needs translation" view from English to Spanish.
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.
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.
Select a plan to suit you and enter your payment details.
In Data Fetcher, click "I've done this".
Next, select the Trigger tab and underneath, click "+ Authorize".
Accept the prompt "I understand, let's Authorize".
Click "+ Add a base".
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".
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.