I’m wondering if its possible to create a file, encode it and then add it as an attachment. Since the attachment field needs a url the only way for me to do this would be to make an api call from within the script to store the file in an AWS s3 bucket, return that url and then attach. This seems like a huge work around. For now I can just use the raw text field in the text field, if the large text file fits, but for formated xlx files for example this won’t work.
Seems like a long workaround just to output a file, is there another way to do this?
Yes, you can use Airtable’s upload attachment endpoint to upload a Base64-encoded file into an attachment field.
Note that this method has a 5 MB limit per file. To upload files larger than this, you would need to use the URL method of uploading files.
- ScottWorld, Expert Airtable Consultant
Thanks for the response! I’m doing this from a script not the web api. Is it possible to do this from a script?
Sorry, I’m not sure about that one, because I do not use scripting. But hopefully somebody else can help answer that!
Got it. So what are you doing, creating AWS lambda functions that interact with your base? I’ve done that a couple of times to get over the scripting timeout limits and to gain access to libraries I might need that are not available in the scripting environment. It just involves a bit more setup, either in the AWS console or with serverless framework https://www.serverless.com/ or SST. Curious about your setup, I’m going to try out SST https://sst.dev/. I’ve been using serverless.
My workflow uses Make, so It’s different than what you’re trying to do.
Got it. I experimented with make but found that it gets pretty expensive it you are trying to do something like write a lot of data to an excel. Its also pretty slow and hard to debug. Good for short simple workflows.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.