How to creat a record while using input.fileAsync

My question as below:

I use this script:

Let attachment = await input.fileAsync('Pls upload the cargo packing list')

Then I want to create a new record with one field as MultipleAttachment.
I want this MultipleAttachment field having the attachment input above by input.fileAsync.

As per the API, the MultipleAttachment written format as below:

Array<{
url: string,
filename?: string,
}>

How could I achieve my goal? I don’t know how can I have the url of the uploaded file by fileAsync.

Thanks

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