I'm getting this error in my application
I call the interface with the upload field in the forms and at one of the primary buttons i call the function a!submitUploadedFiles(). "at function a!buttonWidget".
I cant understand what can i do for this to work. Already checked the version of the buttons and forms. It's all up to date.
Can some help me ?
Discussion posts and replies are publicly visible
I tried to replicate your requirement, have a look at it(v25.3).
a!localVariables( local!document, local!documentSize, a!formLayout( contents: { a!fileUploadField( label: "Upload Document", target: {}, /*Replace this with you target folder*/ value: local!document, saveInto: { local!document, /* Handle list of documents */ a!save( local!documentSize, if( or(isnull(local!document), length(local!document) = 0), null, document(local!document[1], "size") /* Get first document */ ) ) }, maxSelections: 1 /* Limit to single file */ ), /* Display the captured size */ a!textField( label: "Document Size (bytes)", value: local!documentSize, readOnly: true ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Submit", submit: true, saveInto: { /* Your other save logic here */ } ) } ) ) )
I used it in an test interface. I'm using 25.1 version of Appian.This error appears
It's because the document isn't saved anywhere and i can't access the document function because i dont have AppianDocId, i guess. Is that correct ?
No, Actually you are currently on 25.1 and 25.3 improved the file upload handling to make document properties available immediately in saveInto.
Shubham Aware said:25.3 improved the file upload handling to make document properties available immediately in saveInto.
checking on this now - if they did that it would be amazing, and it makes me wonder why they didn't announce it (I do see there's an exciting new change in the Release Notes that I didn't notice before).
Edit: is the real update actually in the document() function then? In that it now allows access to properties of a just-uploaded file...Update: yup, it works as they promised!...