Hi,I am facing an issue where I am getting Expression evaluation error at function a!forEach [line 44]: Error in a!forEach() expression during iteration 1: Expression evaluation error in rule 'es_copy_ucaa_cmpt_fileupload' at function a!fileUploadField [line 27]: Error in a!forEach() expression during iteration 1: Expression evaluation error at function fn!content_appian_internal [line 35]: Invalid Content ID.please help me to resolve this issue
a!fileUploadField(label: ri!label,labelPosition: if(a!defaultValue(ri!showLabel, true),null,"COLLAPSED"),helpTooltip: ri!helpTooltip,target: ri!folderId,value: index(ri!documents, "appianDocId", null),saveInto: {a!save(ri!documents,a!forEach(items: tointeger(save!value),expression: a!update(data: cast('type!{urn:com:appian:types:PRI}PRI_Document',rule!GBL_indexWhere(value: fv!item,initialArray: index(ri!documents, "appianDocId", {}),finalArray: ri!documents)),index: {"appianDocId","questionAttribute","questionName","documentIdentifier"},value: {fv!item,ri!questionAttribute,ri!questionName,ri!identifier})))},required: ri!isRequired,requiredMessage: ri!requiredMessage,buttonDisplay: "ICON",maxSelections: ri!maxDocuments)
Discussion posts and replies are publicly visible
This error usually occurs when document does not exist. You can simply check if document exists then only show fileupload() field. You can use something like:getcontentobjectdetailsbyid(ri!docId ) <> "No object with this ID has been found"