Get number of uploaded files

Hi everyone, I’m pretty new to baserow, I had past experience (many years) with Mysql, just a little with Microsoft SQL server.
Formula field is very useful, however seems not possible to get the number of uploaded files in a file field… is there any solution apart from creating a separate field and manually count the n. of files?

Hi,

My suggestion would also be to use a formula, but unfortunately you cannot reference to a field of the type file in Baserow.

The only alternative I see is using an automation service like Zapier, Make or N8N. You can use a webhook to check if a record is updated, count the amount of elements in the files field and update the field that counts them.

Regards
Frederik

Hi, thanks for your reply,
actually I’m using Make, I wasn’t aware that this was possible (maybe using iterator function?)
appreciated suggestion

You can create the automation using the following steps:

  1. Create a column (field) in your table that will hold the amount of images
  2. Go to make, create a new scenario and add a “Custom Webhook as a trigger”
  3. Go back to Baserow and create a Webhook for your table by clicking the 3 vertical dots next to the table and select “Webhooks”
  4. Copy / Paste the url from the Make Webhook in the URL field, start the automation and test if the webhook works
  5. Go to make and add the “Update existing row” node from Baserow. Configure the node like the screenshot below

I get the ID as a response in the items object. And I use the length() function in Make on the field Files to get the length. This is used to update the field “Amount of Files”

This automation is of course for all new changes to your base. If you want to create an automation that sets an initial value, you will indeed need to list all your rows, use an iterator to loop over them and update each row with the length of the field Files.

Hope this solves your issue.

Regards
Frederik