Help

Re: Expand record feature on script (with output API?)

2593 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Kenny_DITS
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi everyone,

Is there any way on a script to link to a record directly from the script window with the output object ?

My usecase is the following : We use a script to detect all missing information in a table and show records where some are missing. We use output.table for that and it works great, but it lacks a way to be able to expand the corresponding records to directly modify it without being forced to do a search on the view panel to find the same records.

Thanks for the help :winking_face:

9 Replies 9

Yes. The clue here is output.markdown() which supports tables and text with embedded links.

Thanks Bill for the answer. I already use output.table and output.markdown() but don’t find any way to have a link to an expand view of the record with that ? you know what i mean ? :slightly_smiling_face:

I believe I do and it works great for me -

image

Oh ok, i understand the difference. Sorry for not being clear.
What i want is the Record Id here to be expandable. You’re right that a “link to another record” field works, but i don’t see how i can have the whole records itself expandable.
In your example, i want to be able to click on the record id for example.

Thanks again for your time

Okay, and then what happens exactly?

It open the same popup when you expand a record on a view list or when you click on a “linked field” records

Like this?

In case this is what you were hoping for - here’s the script block:

output.markdown('# Record Linking Example');

// select the table
let currentTable = await input.tableAsync('Select a table');
let queryResults = await currentTable.selectRecordsAsync();
let oRecords     = queryResults.records;

// build the list
var recordList = "| Record ID   | Name        |\n";
recordList    += "| ----------- | ----------- |\n";
for (let record of oRecords)
{
    thisName = "";
    recordList += "|[" + record.id + "](" + currentTable.url + "/" + record.id + ")|" + record.name + "|\n";
}

// render the list
output.markdown(recordList);
Kenny_DITS
5 - Automation Enthusiast
5 - Automation Enthusiast

A little bit different than what i expected (because it open a new browser tab instead of staying in the same tab and instance of airtable), but it will do the job i think.
I was expecting a native way for airtable to have a link to the expand card, but forging the whole url seems to work.

Thanks again for your help on that. :winking_face:

This is possible as well but with — and only with — a custom block (i.e., a React app).