Expression evaluation error: a!submitUploadedFiles() cannot be evaluated in this environment.

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

Parents
  • 0
    Certified Lead Developer

    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 ? 

Reply Children