Question
Document upload field
Interface Definition: Expression evaluation error [evaluation ID = af95d:a8823] : An error occurred while executing a save: Expression evaluation error: The save target must be a local variable that does not refresh on every evaluation or on an interval, a process variable, or a node input (or a rule input passed one of those three), but instead was: [documentId=, mappingKey=1, entityType=, entityId=, docType=, docName=, docExtension=, docDescription=, appianDocId=, isActive=, createdBy=, createdDate=, lastUpdatedBy=, lastUpdatedDate=].
In my interface, I can add multiple lists and in each list, I have multiple documents. This is my requirement.
a!gridLayout(
label:"",
headerCells:{
a!gridLayoutHeaderCell(label:"Upload"),
a!gridLayoutHeaderCell(label:"DocDescription"),
a!gridLayoutHeaderCell(label:" ")
},
columnConfigs:{},
rows:{
a!forEach(
items:{
if(
ri!isReadOnly,
ri!Document,
if(rule!FCO_isNullOrBlank(ri!Document),
null(),
ri!Document[wherecontains(local!mappingId,ri!Document.mappingKey)]
)),},
expression:a!gridRowLayout(
contents:{
a!fileUploadField(
label:"Upload Document",
target:cons!SHA_FOLDER,
maxSelections:1,
value:index(local!Doc,"appianDocId",null),
saveInto:fv!item.appianDocId,
required: true(),
requiredMessage:"Please upload document",
disabled:ri!isReadOnly
),
a!textField(
label:"docdescription",
placeholder:"enter doc description",
value:index(local!Doc,"docDescription",null),
saveInto:fv!item.docDescription,
required: true(),
readOnly:ri!isReadOnly
),
a!richTextDisplayField(
labelPosition: "",
value: {
a!richTextIcon(
icon:"trash-o",
link: a!dynamicLink(
value:fv!index,
saveInto:a!save(ri!Document,remove(ri!Document,fv!index))
),
color:"NEGATIVE",
size:"STANDARD"
)
}
)
}
)
)
},
selectionValue:ri!Document,
selectionSaveInto:ri!Document,
selectable: {},
selectionRequired:false,
selectionDisabled:{},
addRowLink:a!dynamicLink(
label: "Upload New File",
value:true(),
saveInto:{
a!save(
ri!Document,
append(
ri!Document,
a!forEach(
index(reverse({save!value}),1),
'type!{urn:com:appian:types:SHA}SHA_document'(
mappingKey: local!mappingId
)))),
local!Doc
}
),
validations: {},
shadeAlternateRows:true
)So when I am trying to upload a document I am unable to save it it throws me the above error! Can anyone please help me with this error!
