Help

How to add files along with other records

Topic Labels: Extensions
Solved
Jump to Solution
1635 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Fredrick_Esedo
5 - Automation Enthusiast
5 - Automation Enthusiast

I have a table that is suppossed to create records for file attachment and other details.

Juding from code below, How do I attach files along with other records in airtable.

Do I have to convert the file to base64 or just upload the files to a remote server and then add the file links in the record.
How does air table programmatically handle files attachments be it photos, pdf, videos etc. can someone help me out with the code below

Thanks

const files_tab = base.getTableByNameIfExists('myfiles_table');
const ok = files_tab.createRecordAsync({'title': 'file title','description': 'file details', 'myfile': 'my file attachment goes here'});
1 Solution

Accepted Solutions
Matthew_Thomas
7 - App Architect
7 - App Architect

You should be able to add any URL that points to a file in the value for ‘myfile’ (which assumes you have a Field with the same name). This custom block documentation describes the parameters for multiple attachment fields.

This would assume the file is located at an addressable URL (already uploaded somewhere on the internet). It doesn’t appear that custom blocks directly supports file input yet (the scripting block does with input.fileAsync. However, one of the custom block examples, JSON Import Block includes this functionality, much of which can be seen in the open source GitHub repo (this file in particular seems relevant to your problem).


If this answers your question, please consider marking it as “solution”. If not, I’m happy to work with you further. Thanks!

See Solution in Thread

1 Reply 1
Matthew_Thomas
7 - App Architect
7 - App Architect

You should be able to add any URL that points to a file in the value for ‘myfile’ (which assumes you have a Field with the same name). This custom block documentation describes the parameters for multiple attachment fields.

This would assume the file is located at an addressable URL (already uploaded somewhere on the internet). It doesn’t appear that custom blocks directly supports file input yet (the scripting block does with input.fileAsync. However, one of the custom block examples, JSON Import Block includes this functionality, much of which can be seen in the open source GitHub repo (this file in particular seems relevant to your problem).


If this answers your question, please consider marking it as “solution”. If not, I’m happy to work with you further. Thanks!