You could use Airtable’s new SWITCH function.
You would need to create a new field called “Logo URL” and make it a formula field.
The formula would be something like.
SWITCH({company name},“Company A”,“URL Of Company A’s Logo”,“Company B”,"URL Of Company B’s Logo ",“No Match”)
After that create a simple Zap to fetch the URL from the “Logo URL” field and populate the corresponding “Logo” field with the correct company logo image
Where you able to get this to work?
This post is a bit dated, but since the automations have been released, it’s now possible to fetch logos automatically (via the Clearbit API for example).
In my specific case, I wanted Airtable to add a company’s logo as soon as I added their website in a URL type field.
So here’s how I did it:
Trigger
- “When a record matches conditions”
- “When Website is not empty and Logo is empty”
Actions
Run a script
let table = base.getTable('TableName');
let query = await table.selectRecordsAsync();
for (let record of query.records) {
// if the attachment field is empty
if(record.getCellValue('Logo') == null && record.getCellValue('Website') != null) {
let recordId = await table.updateRecordAsync(record, {
'Logo':
{ url: 'https://logo.clearbit.com/'+record.getCellValue('Website')}
]
})
}
}
And that’s it, as soon as you add a URL, Airtable will automatically download the company logo.
This post is a bit dated, but since the automations have been released, it’s now possible to fetch logos automatically (via the Clearbit API for example).
In my specific case, I wanted Airtable to add a company’s logo as soon as I added their website in a URL type field.
So here’s how I did it:
Trigger
- “When a record matches conditions”
- “When Website is not empty and Logo is empty”
Actions
Run a script
let table = base.getTable('TableName');
let query = await table.selectRecordsAsync();
for (let record of query.records) {
// if the attachment field is empty
if(record.getCellValue('Logo') == null && record.getCellValue('Website') != null) {
let recordId = await table.updateRecordAsync(record, {
'Logo':
{ url: 'https://logo.clearbit.com/'+record.getCellValue('Website')}
]
})
}
}
And that’s it, as soon as you add a URL, Airtable will automatically download the company logo.
Hello !
Thanks a lot for your script. However, it doesn’t seem to filter the files Clearbit can’t found. It looks like it just adds the URL instead.
Would you know a way to fix that, and add the logo only if it is a png/jpg file ?
Anyway, thank you for your work, and for sharing ! It really helps.
This post is a bit dated, but since the automations have been released, it’s now possible to fetch logos automatically (via the Clearbit API for example).
In my specific case, I wanted Airtable to add a company’s logo as soon as I added their website in a URL type field.
So here’s how I did it:
Trigger
- “When a record matches conditions”
- “When Website is not empty and Logo is empty”
Actions
Run a script
let table = base.getTable('TableName');
let query = await table.selectRecordsAsync();
for (let record of query.records) {
// if the attachment field is empty
if(record.getCellValue('Logo') == null && record.getCellValue('Website') != null) {
let recordId = await table.updateRecordAsync(record, {
'Logo':
{ url: 'https://logo.clearbit.com/'+record.getCellValue('Website')}
]
})
}
}
And that’s it, as soon as you add a URL, Airtable will automatically download the company logo.
It works for me!! Thanks
This post is a bit dated, but since the automations have been released, it’s now possible to fetch logos automatically (via the Clearbit API for example).
In my specific case, I wanted Airtable to add a company’s logo as soon as I added their website in a URL type field.
So here’s how I did it:
Trigger
- “When a record matches conditions”
- “When Website is not empty and Logo is empty”
Actions
Run a script
let table = base.getTable('TableName');
let query = await table.selectRecordsAsync();
for (let record of query.records) {
// if the attachment field is empty
if(record.getCellValue('Logo') == null && record.getCellValue('Website') != null) {
let recordId = await table.updateRecordAsync(record, {
'Logo':
{ url: 'https://logo.clearbit.com/'+record.getCellValue('Website')}
]
})
}
}
And that’s it, as soon as you add a URL, Airtable will automatically download the company logo.
Hi !
Had the same issue.
When the logo is not recognized, the automation keeps running and running et runs out all the automations
why could be the solution ?