Encountering below error while trying to run code below.
Error:
Interface Definition: Expression evaluation error [evaluation ID = 9LP29QBA] : An error occurred while executing a save: Expression evaluation error: You must specify a variable to save into, such as ri!name << fn!sum. Received: CAS_CashEntry?list.
Code:
with( local!sourceTransaction: {}, a!forEach( items: ri!cashEntries, expression: if (ri!cashEntries.isAdjusted = false, { local!sourceTransaction: rule!CAS_getSourceTransaction( cashEntryId: ri!cashEntries.cashEntryId ), ri!cashEntries: rule!CAS_getCashEntryId( cashEntryId: local!sourceTransaction ), if( ri!cashEntries.allocationTypeId = 5, { a!save(ri!cashEntries.suspenseIsOpen = true), a!save(ri!cashEntries.isAdjusted = false) }, a!save(ri!cashEntries.isAdjusted=false) ), a!writeToMultipleDataStoreEntities( valuesToStore: a!entityData( entity: cons!CAS_DSE_CASH_ENTRY, data: ri!cashEntries ) ) } , {} ))),
Discussion posts and replies are publicly visible
Hint: check out the syntax for a!save() here: https://docs.appian.com/suite/help/19.3/fnc_evaluation_save.html
Yeah to add to what Stewart said, the equal sign in Appian is never used for assigning a value to a variable; it is always used for a comparison. I know this is different than a lot of other programming languages, but a good rule of thumb is that = in Appian is most similar to the == in other programming languages. Also sometimes I try to see new developers use the double equals, but that doesn't do anything in Appian!