Help

Launched: upload files in the scripting block!

cancel
Showing results for 
Search instead for 
Did you mean: 
Billy_Littlefie
7 - App Architect
7 - App Architect

We’re excited to announce a new input method for the scripting block: input.fileAsync! This enables script users to upload files, which the script can then use to do things like create or update records.

If you’ve ever wanted to preprocess the data in your files before importing it to your base with the CSV or XML import block, you can now do so with input.fileAsync! Because you can access the file contents from inside the script, you could also do things like conditional record creation or custom fuzzy matching to update existing records. We’re excited to see how you can use this to empower your scripts!

The returned value from the file input gives you access to the uploaded File itself, as well as the parsed contents of the file (if supported). Currently, parsing is automatically performed for .csv, .xls, .xlsx, .json, .xml, and .txt files, giving you immediate access to the underlying data. Check out the full documentation for input.fileAsync in the API reference inside the block, or take a look at the new “Spreadsheet importer” example.

Here’s a quick demo of the file input in action:

file-input-example

Cheers, and happy scripting!

3 Comments
Jeremy_Oglesby
14 - Jupiter
14 - Jupiter

Yes! Can’t wait to try this out in my budgeting base!

Arnau_Rovira
4 - Data Explorer
4 - Data Explorer

Hi, thanks for this! @Billy_Littlefield - Really useful

Currently, parsing is automatically performed for .csv, .xls, .xlsx, .json, .xml, and .txt files, giving you immediate access to the underlying data.

Any ideas on how to parse PDFs? Are you working on this as well?

Bill_French
17 - Neptune
17 - Neptune

Theoretically, you could use pdf.js and perform the text extractions in script block. I typically use an integrated approach to NodeJS or Google Apps Script to handle this level of parsing because it’s pretty complex and often times, best to use AI rather than brute force extractions.