Help

URL markdown from automation without a formula field

Topic Labels: Automations
Solved
Jump to Solution
103 2
cancel
Showing results for 
Search instead for 
Did you mean: 
sam_i_am
5 - Automation Enthusiast
5 - Automation Enthusiast

Hello,

This is a variant on an earlier topic. I have a base where users input lengthy URLs into several fields, and corresponding display text in separate fields. I've been using the workaround where a formula field does this calculation:

 

CONCATENATE("[",{name},"](",{URL},")")
 
and an automation takes that field and copies it into a rich-text-formatted long text field. It's clunky, and even clunkier when you have a bunch of markdown formula fields in your base. I'd like to do this with just an automation, but when I try to do it exactly the same way, I get text output like 
 

[Airtable

](www.airtable.com)

whereas my formula approach gives Airtable 

 

Here's the automation script I'm using. Any advice is greatly appreciated!

 

 

let inputConfig = input.config();

let theURL = inputConfig.theURL;
let displayName = inputConfig.website;
let recordID = inputConfig.recordID;

let thisTable = base.getTable('Table 1');
let blank="";
let markup = blank.concat("[", displayName, "](",theURL, ")");

await thisTable.updateRecordAsync(recordID, {
     "website"    :   markup
})


output.set(markup, "marked up");

 

 

 

1 Solution

Accepted Solutions
sam_i_am
5 - Automation Enthusiast
5 - Automation Enthusiast

Ok I was able to work it out. I'm not actually sure what the problem was because I changed a couple of things at once. Here's my solution:

1) Set the "Simple name" and "URL" fields to one line text. Website is a long text with rich text formatting. Create a calculation that's the time difference between modifications

 

DATETIME_DIFF(LAST_MODIFIED_TIME(URL, {Simple name}), LAST_MODIFIED_TIME(website))

 

sam_i_am_0-1719511400790.png

2) Create an automation triggered by the calculated time exceeding some number. I set it to 0:00.1. That might need to be tweaked later depending on how Airtable backend does things, so I'll monitor that

sam_i_am_1-1719511512222.png

 

3) Create a script as such:

sam_i_am_2-1719511602611.png

 

 

let inputConfig = input.config();

let theURL = inputConfig.theURL;
let displayName = inputConfig.SimpleName;
let recordID = inputConfig.recordID;

let thisTable = base.getTable('Table 1');
let blank="";
let markup = blank.concat("[", displayName, "](",theURL, ")");

console.log(markup)

await thisTable.updateRecordAsync(recordID, {
     "website"    :   markup
})

 

 

See Solution in Thread

2 Replies 2
sam_i_am
5 - Automation Enthusiast
5 - Automation Enthusiast

On a side note, this type of URL construction seems like a basic feature that Airtable should support better. I see requests for this going back to 2016. Is there a wishlist this could be bumped up on?

sam_i_am
5 - Automation Enthusiast
5 - Automation Enthusiast

Ok I was able to work it out. I'm not actually sure what the problem was because I changed a couple of things at once. Here's my solution:

1) Set the "Simple name" and "URL" fields to one line text. Website is a long text with rich text formatting. Create a calculation that's the time difference between modifications

 

DATETIME_DIFF(LAST_MODIFIED_TIME(URL, {Simple name}), LAST_MODIFIED_TIME(website))

 

sam_i_am_0-1719511400790.png

2) Create an automation triggered by the calculated time exceeding some number. I set it to 0:00.1. That might need to be tweaked later depending on how Airtable backend does things, so I'll monitor that

sam_i_am_1-1719511512222.png

 

3) Create a script as such:

sam_i_am_2-1719511602611.png

 

 

let inputConfig = input.config();

let theURL = inputConfig.theURL;
let displayName = inputConfig.SimpleName;
let recordID = inputConfig.recordID;

let thisTable = base.getTable('Table 1');
let blank="";
let markup = blank.concat("[", displayName, "](",theURL, ")");

console.log(markup)

await thisTable.updateRecordAsync(recordID, {
     "website"    :   markup
})