When I upload my files, they disappear!!!
Here is the code:
a!fileUploadField( label: "Please upload any pictures, brochures or other documents describing the Project", labelPosition: "ABOVE", target: cons!PMSO_ApplicationDocuments, value: ri!volunteerDocuments, saveInto: ri!volunteerDocuments, showWhen: if( a!isNullOrEmpty( local!applicationDocSubmissionSuccessful ), true, not( local!applicationDocSubmissionSuccessful ) ), validations: {} ),
I checked to make sure that the accounts have Editor access to the folder and the Constant is pointing to the correct folder.
The Rule Input, volunteerDocuments never gets updated.
The funny thing is that this used to work. I tested it many times, and now it doesn't work. The only change to the system was the security patches that were installed.
Discussion posts and replies are publicly visible
Echoing Stefan's answer, but simplifying somewhat: if you're seeing this error in a live task, 99% of the time it means you haven't assigned your form inputs (the interface's rule inputs) into an ACP variable, which is the only way to get user changes made on a form to populate when you want them to be passed back out into the process (like you will for uploaded files).
In the interface editor it will work because you have the component set to save into the RI. But in a running process, the form wants to save from the component, to the RI, then to the ACP (aka "input variable" aka "ac!variable" etc), and when it doesn't get saved into an ACP, it doesn't save anywhere, then the rule input value resolves back to a blank one, thus the component resolves back to being blank. This caveat is sadly just one you need to learn from experience, but after you know about it, it's pretty simple to handle luckily.
Thanks for the feedback. This is a portal, so there is no start form. Sorry, I failed to mention that. I have to call the process model. However, I never get to that point.
First I use the a!fileUploadField function to upload the document and saveInto the ri!volunteerDocuments.
Then I use a!buttonWidget to create a button "Save Files" that uses the function a!submitUploadedFiles. The button displays when the ri!volunteerDocuments are not null or empty. The button never shows up.
Here is the complete JSON.
a!fileUploadField( label: "Please upload any pictures, brochures or other documents describing the Project", labelPosition: "ABOVE", target: cons!PMSO_ApplicationDocuments, value: ri!volunteerDocuments, saveInto: ri!volunteerDocuments, showWhen: if( a!isNullOrEmpty( local!applicationDocSubmissionSuccessful ), true, not( local!applicationDocSubmissionSuccessful ) ), validations: {} ), a!buttonArrayLayout( buttons: { a!buttonWidget( label: "Save Files", saveInto: { a!submitUploadedFiles( documents: ri!volunteerDocuments, onSuccess: a!save( local!applicationDocSubmissionSuccessful, true ), onError: { a!save( local!applicationDocSubmissionSuccessful = false ), a!save(local!applicationDocError = fv!error) } ) }, submit: false, style: "GHOST", color: "ACCENT", showWhen: if( a!isNotNullOrEmpty(ri!volunteerDocuments), if( a!isnotNullOrEmpty( local!applicationDocSubmissionSuccessful ), not( local!applicationDocSubmissionSuccessful ), true ), false ) ) }, align: "CENTER", marginBelow: "NONE" ),
There are no rule inputs in portals. At least not of type "Document". Use local variables.
I suggest to check the examples around the a!submitUploadedFiles() function.
yeah, Rule Inputs in Portal forms are a more recent addition, and they're for input only, not output (as you're trying to do here). Again echoing Stefan's advice to merely use local variables - you can "submitUploadedFiles()" directly from a local variable (though only in portals and sites).