Hello All,
We are using fileUploadField() in editable grid to upload a new document and we want to show the file size of newly uploaded document to be reflected immediately in one of the columns of the grid without submitting the form.
Any help is greatly appreciated.
Thanks,Sonakshi
Discussion posts and replies are publicly visible
You can access a file's properties using fv!files - see here for details:
https://docs.appian.com/suite/help/20.1/File_Upload_Component.html
Stewart Burchell said:You can access a file's properties using fv!files
Of course, that's only in validations though. "fv!files" functionality can't be used for anything external (including saving into helper variables like could be used in this user's use case), which is one of the main reasons behind my old, un-fulfilled feature request.
True! I was hedging my bets, wasn't sure what the actual objective was here...I've held off from the 'hack' that allows you to access the filesize using another file upload component as input to, say, the 'instructions' attribute of the actual file upload component...only because, although it works, it's not supported and there's no guarantee the structure won't change between releases...
Agreed, I try to only use that when absolutely necessary (luckily not very much recently), or the other workaround I eventually noticed which involves using the "getcontentdetailsbyid" plug-in rule (which only allows access to the name and not size, but whatever). It'd be nice if we could handle this all OOB of course.
Hi Mike,Stewart,
It is clear that need to handle this OOB.
Just to brief use case, In editable grid, adding new document and sending those document to third party system. But before sending document need business user to know size of documents.
It would be very helpful if you suggest some OOB solution for achieving this use case.
Thanks,
Vinod
Ok I still don't understand - an editable grid row can contain a file upload component. The file upload component displays the size of the file when you upload it:
What's missing from your requirement that isn't satisfied with this? (also: why do the business users need to know - or care - about the size of the file? If there's a limitation on the size of file they can upload then you'll need to add some validation to your file upload component)
Thanks Stewart!
Agree,The file upload component displays the size of the file when you upload it but there is size column in grid to show size of document. After clicking on related action showing document in grid with size that are fetch from DB but user can upload at runtime and need to populate size of newly added document in grid.
Also, while uploading there is no limitation but there is limitation while sending to third part system(there is validation while sending to external system). Purpose of showing document size in grid is that user can see big documents and can process those document in other system or make it inactive so it wont available for sending.
If the "rules" that determine whether a User processes a "document in other system or make it inactive so it wont available for sending" can be codified then you should automate it, not leave it to the User to decide. You can access an uploaded document's properties in a rule and then route the document accordingly. A User making this decision does not seem to add any value .
This works too but user wants them to decide which one to inactive.
Will discuss this with Business in more details.
Thanks Stewart for your help.