- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Feb 14, 2024 04:51 PM
If anyone could shed light on this I would be appreciative.
In my example, I have two columns, one with a ResourceName, the other a URL. A third column would hyperlink the ResourceName with the URL. Easy peasy? Not so. Still.
A: ResourceName Brown Cow
B: URL https://browncow.com
C: Resource Brown Cow
I tried this script from another thread but, line 2, let query = await table.selectRecordsAsync (); function is deprecated. It does work... for 15 rows but, stops there, and no matter what I try, 15 is all I can get.
let tb = base.getTable("My Resources");
let query = await tb.selectRecordsAsync();
for (let record of query.records) {
let url = record.getCellValue("URL");
let text = record.getCellValue("ResourceName");
if(url) {
tb.updateRecordAsync(record, {"Resource": `[${text}](${url})`})
}
}
I've returned to Airtable a few times in the past several years and have long been perplexed why it does not allow one of the most basic functions of the internet to be used easily. That is, hyperlinking a long-text field with a URL via a script.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Feb 14, 2024 06:21 PM - edited ‎Feb 14, 2024 06:21 PM
Try using updateRecordsAsync instead:
let tb = base.getTable("My Resources");
let query = await tb.selectRecordsAsync();
let updates = []
for (let record of query.records) {
let url = record.getCellValue("URL");
let text = record.getCellValue("ResourceName");
if(url) {
updates.push({
id: record.id,
fields:{
'Resource': `[${text}](${url})`
}
})
}
}
while (updates.length > 0) {
await tb.updateRecordsAsync(updates.slice(0, 50));
updates = updates.slice(50);
}
