Upload several files and save to database

Hello, 
I need help!!
I have this field to upload documents to a database

a!fileUploadField(
label: "Document",
labelPosition: "ADJACENT",
/*maxSelections: 1,*/
value: ri!newDo.docum,
saveInto:
{
ri!newSoli.documentation,
ri!newDo.docum,
a!save(ri!newDo.day,now())
},
target: cons!C_FLD_document,
validations: {}
)

What I want to achieve is that when uploading several documents I can do it and it does not appear
"Expression evaluation error in rule 'cpro_i_nuevasolicitud' at
function a!fileUploadField [line 146]: Error in a!forEach()
expression during iteration 1: Expression evaluation error at
function fn!content_appian_internal
[line 12]: Null Arguments are Invalid"

THANKS



  Discussion posts and replies are publicly visible

Parents Reply
  • Thanks! 

    But I do not know what to put to replace
    local! loadedFiles
    fv! index

    it would be like this?
     a!fileUploadField(
    label: "Document",
    labelPosition: "ADJACENT",
    /*maxSelections: 1,*/
    value: ri!newDo.docum,
    saveInto:
    {
    a!forEach(
    items: ri!newDo.documentation,
    expression: {
    a!save(ri!newDo.documentation[fv!index].fileAttached, fv!item)
    }
    ),
    ri!newSoli.documentation,
    ri!newDo.docum,
    a!save(ri!newDo.day,now())
    },
    target: cons!C_FLD_document,
    validations: {}
    )
Children