Hi Xuewen!
The result of input.fileAsync
will give you the actual File
object, but doesn’t currently upload that file anywhere. The API for MultipleAttachments
cells currently requires a URL, meaning the attachment must be hosted somewhere first. That means that you’ll need to upload the file to a hosting service (programmatically or manually) prior to writing it to the attachment field.
Improving this admittedly cumbersome process for uploading attachments via scripts is a great suggestion - thanks for sharing your desired workflow!
Cheers,
Billy
Hi Xuewen!
The result of input.fileAsync
will give you the actual File
object, but doesn’t currently upload that file anywhere. The API for MultipleAttachments
cells currently requires a URL, meaning the attachment must be hosted somewhere first. That means that you’ll need to upload the file to a hosting service (programmatically or manually) prior to writing it to the attachment field.
Improving this admittedly cumbersome process for uploading attachments via scripts is a great suggestion - thanks for sharing your desired workflow!
Cheers,
Billy
Hi Billy
Many thanks for that.
Sorry i just came back to the forum.
So my understand is that, so far i could not use the scripting, input.fileAsync, to easily generate a record with the file directly from input.fileAsync.
So what I want Airtable to support my workflow is that, once I received in an inquiry, i can use the scripting to analyze the inquiry and establish the records on different tables automatically, which includes the supporting files attached to the inquiry, which should be from mail or some local area in the computer.
Do you have any idea that I can accomplish this goal just by scripting?
Thanks
Hi Billy
Many thanks for that.
Sorry i just came back to the forum.
So my understand is that, so far i could not use the scripting, input.fileAsync, to easily generate a record with the file directly from input.fileAsync.
So what I want Airtable to support my workflow is that, once I received in an inquiry, i can use the scripting to analyze the inquiry and establish the records on different tables automatically, which includes the supporting files attached to the inquiry, which should be from mail or some local area in the computer.
Do you have any idea that I can accomplish this goal just by scripting?
Thanks
So my understand is that, so far i could not use the scripting, input.fileAsync, to easily generate a record with the file directly from input.fileAsync.
You cannot use input.fileAsync
to generate a record. But at @Billy_Littlefield said you can still upload a file to Airtable it just needs to be uploaded somewhereelse that provides file hosting first.
Here is a quick example of uploading a file to airtable:
let table = base.getTable("Inquries");
// As Billy pointed out the file needs to be already be uploaded somewhere and accessable via a URL in order to upload it.
let newAttachmentUrl = 'https://www.rspcasa.org.au/wp-content/uploads/2018/10/Kitten-season-is-here.jpg';
// Include any other fields and their values here.
await table.createRecordAsync({
"Iquriry Name": "Kittens?",
"Attachments": [{ url: newAttachmentUrl }]
});
Hi,
I was wondering if there's already a solution for this without having to host it as an URL somewhere?
Best,
Lois