Skip to main content

Expand record feature on script (with output API?)

  • August 31, 2020
  • 9 replies
  • 51 views

Forum|alt.badge.img+1

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

Forum|alt.badge.img+19
  • Inspiring
  • 3263 replies
  • October 13, 2020

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


Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • 5 replies
  • October 13, 2020

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:


Forum|alt.badge.img+19
  • Inspiring
  • 3263 replies
  • October 13, 2020

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 -


Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • 5 replies
  • October 14, 2020

I believe I do and it works great for me -


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


Forum|alt.badge.img+19
  • Inspiring
  • 3263 replies
  • October 14, 2020

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?


Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • 5 replies
  • October 15, 2020

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


Forum|alt.badge.img+19
  • Inspiring
  • 3263 replies
  • October 15, 2020

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);

Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • 5 replies
  • October 16, 2020

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:


Forum|alt.badge.img+19
  • Inspiring
  • 3263 replies
  • October 16, 2020

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).