In this tutorial, you'll learn how to use Airtable generative AI to create introductions and cover images for a table of blog posts.
What is Generative AI?
Generative AI is any AI tool that can produce content such as images, text, video, and audio when it receives input from a user. Generative AI models are trained with huge amounts of data (mostly human-generated). They learn the relationship between objects in their training data to produce similar content.
In this tutorial, we'll use OpenAI's GPT-4o and DALL-E 3 to generate introductions and cover images for blog posts in an Airtable base. To use these tools, we'll connect to OpenAI's API using the Data Fetcher extension for Airtable.
Setting up the Blog Posts Table
Before you can start using Airtable generative AI, you'll have to prepare the table you want to use. In this case, you'll set up the table to store blog post titles, cover images, and introductions.
Follow these steps to set up the table:
1. Create a table and name it "Blog posts", or use an existing table.
2. Add the following blog post titles to the Name field:
- Tips for launching a book online
- Getting started with non-fiction writing
- 5 must-know grammar rules for writing
3. Rename the Notes field to Introduction.
4. Create a new Grid view called "Needs introduction" and add the following filters:
- Name - is not empty
- Introduction - is empty
The "Needs introduction" view will ensure we only generate introductions for blog posts that don't have any. Let's do the same for images.
5. Create a new field called Image with the type Attachment.
6. Create a new Grid view called "Needs image" and add these filters:
- Name - is not empty
- Introduction - is empty
With the table set up, we can move on to Data Fetcher.
Installing Data Fetcher
1. Add the Data Fetcher extension to your Airtable base. Data Fetcher lets us connect to third-party APIs, like OpenAI, without knowing how to code. This allows you to use the power of generative AI inside Airtable.
2. Once you’ve added the extension, sign in to Data Fetcher or sign up if you don’t have an account.
3. Once Data Fetcher opens in your Airtable base, click Create your first request.
How to Use Airtable Generative AI
Generating Blog Post Introductions
1. Select OpenAI under Application. You can search for it or scroll down the list.
2. Rename the request to something meaningful, like: "Generate blog post introductions".
3. Copy and paste your API key under Authorization. If you don't have an API key, you can generate one in your OpenAI account.
4. Under Endpoint, select Create a model response.
5. Click Save and Continue in the bottom right corner.
You'll be taken to a new section where you'll give the AI instructions for what you want to generate.
Create Effective OpenAI Prompts in Airtable
The quality of AI-generated content depends heavily on the instructions you give the model. These instructions are called prompts.
In Data Fetcher, prompts are entered using the Input field. This field contains everything the OpenAI model needs to know about what to generate, including context, constraints, and references to Airtable fields.
You don’t need to worry about chat-style roles (system, user, assistant). For most Airtable automations, a single clear instruction works best.
Add Your Prompt
1. In the Input field, enter the following prompt text:
Create an engaging social media post about a blog post with the following title. Do not include the blog title in the output.This tells the model:
What to generate (a social media post)
What context to use (a blog post title)
What to avoid (repeating the title)
Reference Airtable Data in the Prompt
Next, we’ll tell OpenAI to use data from your Airtable table.
2. Click the + button on the right-hand side of the Input field.
3. In the window that opens:
- Select Name under Field
- Select Needs post under Run for every record in view
- Click Confirm.
Your Input field will now include a reference to the Airtable record’s Name field. When the request runs, Data Fetcher will send a separate prompt to OpenAI for each record in the Needs post view, automatically inserting the correct blog title each time.
Prompting Tips
Be explicit about formatting and exclusions (for example, “Do not include emojis” or “Limit to 2 sentences”).
Keep prompts concise when running them at scale to reduce cost and improve consistency.
If results aren’t quite right, small wording changes often have a big impact.
Once your prompt is set up, you’re ready to run the request and map the AI-generated output back into Airtable.
Mapping Response Fields
After running the previous steps, Data Fetcher will take you to Response Field Mapping. On this page, you'll select the fields you want from the response data.
The Message field contains the model’s primary text output. For most text-generation use cases, this is the only field you need to map.
Click the Existing field option under "Message", then select "Introduction" from the dropdown.
Click Save and Run in the bottom right corner.
Data Fetcher will populate the "Introduction" field with the text generated from OpenAI. Go back to the default grid view to see the changes.
Generating Cover Images
We'll create a new request in Data Fetcher to generate the cover images.
1. In Data Fetcher, click Home in the bottom left corner to return to the homepage.
2. Click Create Request, then select OpenAI under Application.
3. Rename the request to "Generate cover images".
4. Under Endpoint, select Create an image from a prompt.
5. Click Save and Continue to proceed to the next section.
We'll now give the AI two instructions like we did earlier. Follow these steps:
1. Enter the following text under Prompt, then click the + button to reference the "Image" field in "Blog posts":
Create an artistic cover image for a blog post about this topic:
2. In the window that opens, select Name under Field, then select Needs image under Run for every record in view.
3. Click Confirm.
4. Under Prompt, add the following instruction to complete the prompt:
. Do not add any text to the image.
You'll get more accurate images if you add more details and context to the prompt. DALL-E 3 understands properties such as position and colours.
5. Select DALL-E 3 under Model.
6. Select 1792x1024 under Size to get a landscape image.
7. Under More options for this OpenAI endpoint, select Vivid under Style.
8. Click Save and Run in the bottom right corner to proceed to Response Field Mapping.
9. Make sure the Existing field option is toggled under "Image", then click Save and Run.
Once the request has run, check your default grid view to see the AI-generated images. You can click on each image to see it in full screen.
The processes we followed for using Airtable generative AI to create text and images in our table are very similar, and we can summarize the key steps as follows:
- Set up the table you want to add AI-generated content to.
- Install Data Fetcher and create a new request with OpenAI as the application.
- Authenticate with your OpenAI API key and select the action you want to perform.
- Give the AI instructions to generate the content:
- For text, enter the system and user messages.
- For images, enter the prompt.
- Configure the request with the other available settings.
- Import the fields you want from response field mapping.
- Run the request.