[Justin_Barrett] & [kuovonne]
I have installed the scripting app and started by looking to see if a script actually exists for my application, since I am really not a programmer and capable overwriting my own script at this point in time.
I found the following from one of Justin’s previous posts
--------------script found-------------
Just ran a quick test with the scripting block, and it works.
let tb = base.getTable(“URL Test”);
let query = await tb.selectRecordsAsync();
for (let record of query.records) {
let url = record.getCellValue(“URL”);
let name = record.name;
let text = record.getCellValue(“Text”);
if(url) {
tb.updateRecordAsync(record, {“Rich”: ${text}](${url}) - ${name}
})
}
}
Screen Shot 2020-08-26 at 2.12.09 PM
Screen Shot 2020-08-26 at 2.12.09 PM
713×172 7.25 KB
This will only make the hyperlink when there’s a URL in the {URL} field. With a little more twiddling, this could be modified to work via Airtable’s automation system, to automatically create the hyperlink as the record is being edited.
-----------------end script post-------
Do you think this script will work if I just replace the 3 fields called URL, TEXT, and RICH with the names of my associated fields? I am just not sure if I need the NAME field and what this field is actually doing?
When run, Will this script run through all 1000 records in my table?
Ed
[Justin_Barrett] & [kuovonne]
I have installed the scripting app and started by looking to see if a script actually exists for my application, since I am really not a programmer and capable overwriting my own script at this point in time.
I found the following from one of Justin’s previous posts
--------------script found-------------
Just ran a quick test with the scripting block, and it works.
let tb = base.getTable(“URL Test”);
let query = await tb.selectRecordsAsync();
for (let record of query.records) {
let url = record.getCellValue(“URL”);
let name = record.name;
let text = record.getCellValue(“Text”);
if(url) {
tb.updateRecordAsync(record, {“Rich”: ${text}](${url}) - ${name}
})
}
}
Screen Shot 2020-08-26 at 2.12.09 PM
Screen Shot 2020-08-26 at 2.12.09 PM
713×172 7.25 KB
This will only make the hyperlink when there’s a URL in the {URL} field. With a little more twiddling, this could be modified to work via Airtable’s automation system, to automatically create the hyperlink as the record is being edited.
-----------------end script post-------
Do you think this script will work if I just replace the 3 fields called URL, TEXT, and RICH with the names of my associated fields? I am just not sure if I need the NAME field and what this field is actually doing?
When run, Will this script run through all 1000 records in my table?
Ed
In addition to replacing the field and table names, this script needs a few adjustments before it will work on your 1000 records.
tb.updateRecordAsync(record, {'Rich': `s${text}](${url}) - ${name}` })
This line will get you in trouble with Scripting App’s rate limit, and the updates will probably fail after the first 15. There are two workarounds:
(1) Simply put await
in front of the line. This will make the entire script take longer to run, but it is a very simple fix.
await tb.updateRecordAsync(record, {'Rich': `d${text}](${url}) - ${name}` })
(2) Rework the script to update the records in bulk after the loop. This requires a little bit more work, but is quite easy for someone familiar with JavaScript and the Scripting API.
Other notes:
if(url) {
This line means that the record will be updated only if there is a url. Note that if there is a url but no text, the link won’t work because there will be no text.
let name = record.name;
record.name
is the value of the primary field. You don’t really need it. If you get rid of it, get rid of it in both places:
await tb.updateRecordAsync(record, {'Rich': `e${text}](${url})` })
Kuovonne
Once again I appreciate your help, but the very sad happenings at the Capitol yesterday set me back from answering you sooner.
The following is the script I just tried, but did not work
let tb = base.getTable(‘Race Listing copy’);
let query = await tb.selectRecordsAsync();
for (let record of query.records) {
let url = record.getCellValue(‘Photos Link’);
let text = record.getCellValue(‘Description 2’);
if(url) {
await tb.updateRecordAsync(record, {‘Description 3’: ‘${text}’ })
}
}
The result is not correct
My result is: ${text}
in every record of field Description 3

Any ideas?
Photos Link is a URL field
Description 2 is a Formula field ( I also tried a short text field instead)
Description 3 is a long text with rich text enabled
[Justin_Barrett] & [kuovonne]
I have installed the scripting app and started by looking to see if a script actually exists for my application, since I am really not a programmer and capable overwriting my own script at this point in time.
I found the following from one of Justin’s previous posts
--------------script found-------------
Just ran a quick test with the scripting block, and it works.
let tb = base.getTable(“URL Test”);
let query = await tb.selectRecordsAsync();
for (let record of query.records) {
let url = record.getCellValue(“URL”);
let name = record.name;
let text = record.getCellValue(“Text”);
if(url) {
tb.updateRecordAsync(record, {“Rich”: ${text}](${url}) - ${name}
})
}
}
Screen Shot 2020-08-26 at 2.12.09 PM
Screen Shot 2020-08-26 at 2.12.09 PM
713×172 7.25 KB
This will only make the hyperlink when there’s a URL in the {URL} field. With a little more twiddling, this could be modified to work via Airtable’s automation system, to automatically create the hyperlink as the record is being edited.
-----------------end script post-------
Do you think this script will work if I just replace the 3 fields called URL, TEXT, and RICH with the names of my associated fields? I am just not sure if I need the NAME field and what this field is actually doing?
When run, Will this script run through all 1000 records in my table?
Ed
To tag a user (i.e. alert them to your comment), type the @ symbol, then just wait a moment. If you’re in the middle of an existing thread, the forum will show a popup containing the usernames of everyone who has contributed to that thread. Use the cursor up and down keys to navigate the list and select the person you’d like to tag, then hit Enter. (If you’re starting a new thread, you’ll need to type the first couple of characters of the username, and the forum will show a similar list of users matching your partial tag.)
To tag a user (i.e. alert them to your comment), type the @ symbol, then just wait a moment. If you’re in the middle of an existing thread, the forum will show a popup containing the usernames of everyone who has contributed to that thread. Use the cursor up and down keys to navigate the list and select the person you’d like to tag, then hit Enter. (If you’re starting a new thread, you’ll need to type the first couple of characters of the username, and the forum will show a similar list of users matching your partial tag.)
@Justin_Barrett Got it, thanks!
Kuovonne
Once again I appreciate your help, but the very sad happenings at the Capitol yesterday set me back from answering you sooner.
The following is the script I just tried, but did not work
let tb = base.getTable(‘Race Listing copy’);
let query = await tb.selectRecordsAsync();
for (let record of query.records) {
let url = record.getCellValue(‘Photos Link’);
let text = record.getCellValue(‘Description 2’);
if(url) {
await tb.updateRecordAsync(record, {‘Description 3’: ‘${text}’ })
}
}
The result is not correct
My result is: ${text}
in every record of field Description 3

Any ideas?
Photos Link is a URL field
Description 2 is a Formula field ( I also tried a short text field instead)
Description 3 is a long text with rich text enabled
Thank you for including the screen capture.
It looks like you are using a straight quote '
instead of a backtic ` in this line:
await tb.updateRecordAsync(record, {'Rich': `c${text}](${url})` })
When use the backtic character around the string, ${variable name}
is replaced by the variable value. If you use straight quotes, it is not.
This forum sometimes garbles the display of quotes and backtics.
Thank you for including the screen capture.
It looks like you are using a straight quote '
instead of a backtic ` in this line:
await tb.updateRecordAsync(record, {'Rich': `[${text}](${url})` })
When use the backtic character around the string, ${variable name}
is replaced by the variable value. If you use straight quotes, it is not.
This forum sometimes garbles the display of quotes and backtics.
@kuovonne
That was it! Works Great!
9 min run time, and then I use automation for updates…
Thanks to both of you, Justin also!
Have a great day! :thumbs_up:
This could be done using an automation to update a long text field with rich text enabled. The rich text markdown for building a clickable link is:
[Link text here](URL here)
Make a new automation that runs when either the text or URL fields are updated. The only action step that you need is “Update record”, where you combine the contents of those fields into a long text field with rich text active, wrapping the brackets/parentheses around the appropriate pieces:

The important thing to note, though, is that the URL can’t be “abbreviated”. I ran a test using just “www.justinsbarrett.com” in the URL field, but it led to an error trying to open the site. You’ll need the full “http://” prefix in front of the URL for it to work.
Just wanted to let you know this saved me hours of work :grinning_face_with_big_eyes:
Thank you!
So what’s the current best way to import a column of hyperlinks from a google sheet given all the updates since the initial posting of this thread?
Yes, please! We stash links from SharePoint which are ugly.