Hi All,
I have a requirement to upload attachments to a target folder location and assign them before perform submit on UI screen. Is there ant way I can achieve this?
Thanks in advannce.
Discussion posts and replies are publicly visible
Hi @Stefan Helzle
- Thanks for the response. We are trying to get the doc from user in portal and use that as ri for integration as mentioned below. We won't be able to do the same when the file is not available in Appian. Do you know any other option to handle this scenario?Along with that I have checked the documentation and it is suggested to use submitUploadedFiles() function and this have same condition on working only with saveinto of Submit https://docs.appian.com/suite/help/23.1/fnc_system_a_submituploadedfiles.html#example
What are you missing? The docs describe, how you get a file uploaded to Appian.
But maybe that integration has a secret to it. If you share a few more details ...
We are trying to send the document as the request to the integration. If I browse and select the file from the Appian folders I will get the response as below.
If we try to use the file not available in the Appian (Like temp file uploaded in the interface but nor submitted yet), we are getting the below error. Can you let me know what information would be helpful to clarify this query?
Unknown said:we try to use the file not available in the Appian
Is this after you call submitUploadedFiles()? Can you share the code snippet of your portal form where you're trying to handle this and/or trying to call the above integration? Because AFAIK there's no expectation that the file will be accessible until it's been moved to the Appian FS.
Hi Mike - Find the below code that is working which have Submit=True on the Button. This code works in the interface level as the flow won't move further even thought Submit=true. So File will be uploaded in the Appian target folder and when I call the integration with another button it is working. Is there a way we can use "submitUploadedFiles" function without submit button?
The first thing I'd be trying here is to call the integration from within the "onSuccess" parameter of the a!submitUploadedFiles function, instead of from its own button. What happens when you try this?
Hi Mike - Tried that & not able to resolve the issue.
Any other suggestions on this?
The documentation seems a tad unclear on this, but I suspect having the buttonWidget marked as "submit" on the portal form is either irrelevant, or potentially harmful. Hopefully just the former.
The different variations you listed seem like they should cover this scenario if anything will work at all. I would note that you should definitely be testing from the Portal itself as opposed to from the interface designer (at best, both would work, but at worst, the interface designer might give misleading behavior). Sorry if this part seems obvious but you haven't specified.
Can you post the current state of your button code for, at least, the first bullet point? I'd like to at least verify it looks like I was thinking it should look.
And can you confirm also, if you leave the two functions designated as separate buttons, that it *does* correctly perform the behavior you're after, as long as you click the two buttons in the correct sequence?
/*If I pass the integration call in onSuccess part & submit:True for the button -> File uploaded in Appian & Integration not called*/
buttons: { a!buttonWidget( label: "Button", style: "NORMAL", saveInto: { a!submitUploadedFiles( onSuccess: { a!save(local!submissionSuccessful, true), a!save( local!responseData, rule!File_Upload_Check( doc: local!file, doc_Type: "Test_Dummy" ).result.body.success ) }, onError: { a!save(local!submissionSuccessful, false), a!save(local!errorCode, fv!error) } ) }, submit: true, validationGroup: "Test" ) }
/*If I pass the integration call in onSuccess part & submit: True has been commented for the button -> File not uploaded & Appian Integration not called at all*/
buttons: { a!buttonWidget( label: "Button", style: "NORMAL", saveInto: { a!submitUploadedFiles( onSuccess: { a!save(local!submissionSuccessful, true), a!save( local!responseData, rule!File_Upload_Check( doc: local!file, doc_Type: "Test_Dummy" ).result.body.success ) }, onError: { a!save(local!submissionSuccessful, false), a!save(local!errorCode, fv!error) } ) }, /*submit: true,*/ validationGroup: "Test" ) }
/*If I pass the integration call in as 2nd saveinto part next to a!submitUploadedFiles function & submit:True for the button -> File not uploaded & Appian Integration not called*/
buttons: { a!buttonWidget( label: "Button", style: "NORMAL", saveInto: { a!submitUploadedFiles( onSuccess: { a!save(local!submissionSuccessful, true) }, onError: { a!save(local!submissionSuccessful, false), a!save(local!errorCode, fv!error) } ), a!save( local!responseData, rule!File_Upload_Check(doc: local!file, doc_Type: "Test_Dummy").result.body.success ) }, submit: true, validationGroup: "Test" ) }
Respectfully, I'd request you edit this comment and re-paste your code into a code box (make sure indentation is carried over - this works fine at least when you directly copy it from the interface designer); it's really hard to read otherwise.