Forum Discussion
AustinK
5 years agoQrew Commander
I see where you had posted about this previously and even see the thread you posted in. https://community.quickbase.com/communities/community-home/digestviewer/viewthread?MessageKey=1ffadf07-9840-4550-a49d-c2b3f1dde0fa&CommunityKey=d860b0f8-6a48-487b-b346-44c47a19a804&tab=digestviewer
These are in JavaScript because afaik this cannot be done in a native way, I don't think. I see you replied to Dan there, is the issue that you need the script adapted to your exact use case? Have you given it a try at all and do you have anything started that can be worked off of?
To make the code in the post you replied to work you will need some changes. That specific code works by looking for a change in a field on the form which sounds different than what you want. Can you describe the exact workflow you expect here? To me it sounds like you need this: The record opens and the script runs and pulls the size of the file attachment, It then compares this size to the size in a field called "File Attachment - Old Size" and if the current value is smaller than that value it marks a checkbox saying the record is complete, if there is no older value it puts the current value into the "File Attachment - Old Size" field. Something like that?
These are in JavaScript because afaik this cannot be done in a native way, I don't think. I see you replied to Dan there, is the issue that you need the script adapted to your exact use case? Have you given it a try at all and do you have anything started that can be worked off of?
To make the code in the post you replied to work you will need some changes. That specific code works by looking for a change in a field on the form which sounds different than what you want. Can you describe the exact workflow you expect here? To me it sounds like you need this: The record opens and the script runs and pulls the size of the file attachment, It then compares this size to the size in a field called "File Attachment - Old Size" and if the current value is smaller than that value it marks a checkbox saying the record is complete, if there is no older value it puts the current value into the "File Attachment - Old Size" field. Something like that?
MichaelTamoush
5 years agoQrew Captain
Thanks Austin. I don't know that I ever realized my old thread had more responses. I will look through it again and try a few things and let you know exactly where I get stuck (if I do). All I really am hoping to do is, someone uploads a photo, script runs and returns the file size and says "if file size > 300kb (I'm making up that number, but Ill figure out what kb) then "check a box'.
Essentially, I just need to compare the current file size with a static value and return whether it is larger or not (I don't care if it returns the file size and I use a formula to compare, or if it returns a checkmark, or a 'yes' 'no' or what. I just need anything so I can then natively run formulas, etc).
------------------------------
Mike Tamoush
------------------------------
Essentially, I just need to compare the current file size with a static value and return whether it is larger or not (I don't care if it returns the file size and I use a formula to compare, or if it returns a checkmark, or a 'yes' 'no' or what. I just need anything so I can then natively run formulas, etc).
------------------------------
Mike Tamoush
------------------------------