Feb 11, 2018 11:14 AM
I am having users attach photos and I would like a way to show the size of a file so that we can have an indication of the size of the file attached. Doesn’t anyone have a solution for this?
Thanks in advance for your help.
Sep 29, 2023 09:48 AM
This worked great for me, thank you so much!
Jan 26, 2024 12:45 AM
Is it possible to put the result in a text field with a unit? What file size unit does your script put into the number field?
Jan 29, 2024 10:57 PM
@easecomm yes it is possible I did that in two parts (but you can use just one formula field to do that:
- First I have a column called sizeMB that converts the number to MB: Using this formula [
Is it possible, also, to do that inside the script, but airtable formulas work quite fast that i prefer this method.
Hope you find this helpful.
😉
Feb 26, 2024 01:58 AM
Dear Alvaro, thanks for sharing your automation script. I wonder if you can assist me with troubleshooting the error I am seeing.
Thanks,
Mike
Feb 26, 2024 02:10 AM
Dear @Mike_Gendel :
The error message is indicating that recordId is undefined when it's being used in the selectRecordsAsync function. This could be because input.config().recordId is not returning a value.
To fix this, you need to ensure that recordId is defined before it's used. You could add a check to see if recordId is defined and throw an error if it's not.
In this case, whe we are running a script inside an Automation, we need to set Input Variables here:
That's why your script is giving you an error. And if you had already declare recordId variable. Please be sure that the names are exactly the same.
Hope this helps you!
Feb 26, 2024 02:35 AM
Thanks. I replicated your settings but I still have an error. What am I missing? (By the way, as you can see, I am not an expert in scripting!)
Mar 17, 2024 07:05 AM
hi everyone
Mike I have the solution for you, the place where you input the variable is case sensitive, you should write recordId and not recordid (the last I should be caps). I had the same problem and I solve it just like that.
Alvaro, sos un genio crack, really its amazing, you just save me 50 USD of miniextensions. works as a charm, if you ever read this message write me I would like you to work with me hehe
May 06, 2024 10:54 PM
This is great, it works! But only for the one record that was tested in the automation setup screen.
Excuse the dumb question but how do I set the automation to run for all records in a table?
May 06, 2024 11:22 PM
Never mind. Learnt that automations don't run on historical records with matching pre-existing automation conditions.
So I created a text field, added Automation trigger to match text field, let it run (on 15,000+ records), updated automation to remove that trigger, and delete the now redundant text field.