file upload without Form submission?

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

Parents Reply
  • Hi Mike - Tried that & not able to resolve the issue.

    • If I pass the integration call in onSuccess part & submit:True for the button -> File uploaded in Appian & Integration not called
    • 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
    • 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

    Any other suggestions on this?

Children
  • 0
    Certified Lead Developer
    in reply to Vaithyanathan Raju

    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"
    )
    }

  • 0
    Certified Lead Developer
    in reply to Vaithyanathan Raju

    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.

  • /*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"
      )
    }

    Hi Mike - Thanks for your suggestion. Please find the code & let me know your thoughts

  • 0
    Certified Lead Developer
    in reply to Vaithyanathan Raju

    i was more hoping you'd edit your original comment, but this works too i guess Stuck out tongue

  • 0
    Certified Lead Developer
    in reply to Vaithyanathan Raju

    So i've recreated something similar in my CE site, and I can't get the form (When viewed as a portal) to call the integration correctly at all - I just get a generic message, "The system has encountered an Error".  This is even when trying to call the integration on a tiny document I pre-loaded into my filesystem and reference via a constant.  The same thing works fine when I try it from the Interface Designer.

  • Hi Mike - Thanks for your response. I made some changes and first button with "Submit: true" will save the doc in Appian & I used 2nd button to call the process model in which I configured the integration as smart service which worked Slight smile

  • 0
    Certified Lead Developer
    in reply to Vaithyanathan Raju

    That's a good idea.  Did you happen to try putting both of those functions in the same button?  I'm curious whether it'll work at this point.  I expect *something* along these lines should.