Join the Webstudio community

Updated 4 months ago

Accessing Airtable Lookup Fields

At a glance

A community member is working on a simple database and is having trouble accessing data from a lookup field. They want to display the thumbnail image of the post author, but can only access the record ID, not the actual data. The community member has partially solved the issue by pulling the reference field, but now wants to link the image to the author's URL. However, they are unable to pull the necessary data from the "Author" reference field. Other community members suggest adding a lookup field on the main table to pull the author's image URL, which would make it available like a regular field.

Hey all,
Dabbling with a simple database.
I have got as far as getting items listed and can access most fields easily. The issue is when trying to do a lookup field, I'm stumped.
e.g.
I have cards showing posts.
I want to show the thumbnail for the authors.
I add a collection within each of the items I've created for the posts which pulls data from [Collection Item.fields.author] and its pulling the data fine (gibberish string for record ID).

Now the issue is I can't seem to access the data from that linked record.
Any suggestions?
K
O
J
4 comments
Okay, manged to partially solve by instead just pulling the reference field.
e.g.
collection item.fields.["image from authors]
However,
I want to have the images LINK to a url from the reference.

e.g.
<a href=AUTHORLINK>
<img src=AUTHORIMG>
</a>

And I can only pull the data for one into the parent collection.
If I connect to the "Author" reference field all it pulls is the ids in the array e.g.
[array1, array2, array3]
But I can't find a way to pull data from there for the image and link.

Can anyone help?
Bumping in case anyone else is working with Airtable and has had any other ideas!
can you post your data that you receive from notion? see inspector on the variable in the menu
You probably need to add a lookup field on the main table that pulls in the image url of the author. then its just available like regular
Add a reply
Sign up and join the conversation on Discord