Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!
The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.
Hello, I'm trying to write an array of data using foreach in a write to multiple data store entities, but it gives me error without specifying what could be wrong: here is the code and the error:
a!forEach(
items: pv!getDocuments,
expression: {
a!entityData(
entity: cons!CM_REF_CLAIM_DECLARATION_DOC,
data: 'type!{urn:com:appian:types:CM}cm_ref_claim_declaration_doc'(
idClaimDeclDoc: index(fv!item, "documentId", null),
idDoc: index(fv!item, "documentId", null),
idClaimDecl: pv!id_claim_declaration,
createdBy: index(fv!item, "documentLoadUser", null),
createdOn: index(fv!item, "documentLoadDateTime", null)
)
),
if(
or(
a!isNotNullOrEmpty(fv!item.letterTemplate),
a!isNotNullOrEmpty(fv!item.letterCreationDate)
entity: cons!CM_DSE_LETTER,
data: 'type!{urn:com:appian:types:CM}cm_letter'(
idClaim: pv!claimDeclaration.idClaim,
idRisk: pv!claimDeclaration.idRisk,
sentDate: index(fv!item, "letterSentDate", null),
createdBy: index(fv!item, "letterCreationUser", null),
createdOn: index(fv!item, "letterCreationDate", null),
receivedDate: index(fv!item, "documentReceptionDate", null)
{}
entity: cons!CM_DSE_DOCUMENT,
data: 'type!{urn:com:appian:types:CM}cm_document'(
docName: index(fv!item, "docName", null),
docDescription: index(fv!item, "documentDescription", null),
receiptDate: index(fv!item, "documentReceptionDate", null),
uploadedDate: index(fv!item, "documentLoadDateTime", null),
uploadOwner: index(fv!item, "documentLoadUser", null),
idDocMacroCategory: index(fv!item, "documentIdMacroCategory", null),
idDocMicroCategory: index(fv!item, "documentIdMicroCategory", null),
status: index(fv!item, "letterStatus", null),
sendLetterDate: index(fv!item, "letterSentDate", null),
createdOn: index(fv!item, "documentLoadDateTime", null),
enrichDate: now()
}
Is the "forEach" a problem? How should I write it then?
Discussion posts and replies are publicly visible
Use Insert->Code to enter code lines for better readability in Community