saveInto:{ if(or(isnull(local!searchDeleteUserRole),isnull(local!newUser)),{}, a!forEach( items:rule!KONE_Development_CSE_TENDER_Rule(), expression:a!localVariables( local!tender_Id:fv!item.id, local!status_Id:fv!item.statusId, a!forEach( items:rule!KONE_Development_CSE_TENDER_PHASES_Rule(), expression: if(fv!item.user=local!searchDeleteUserRole, if(local!tender_Id=fv!item.tenderId, if(not(or(local!status_Id=4,local!status_Id=3)), { a!save(target:ri!csetenderphases.user,value:local!newUser), a!save(target:ri!csetenderphases.id,value:fv!item.id), } ,{}) ,{}), {}) ) ) ), ) },
This report " Expression evaluation error [evaluation ID = e8611:77009] : 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: List of Variant.". But i do write ri!csetenderphases.user as the value to save. What's wrong?
Discussion posts and replies are publicly visible
The issue here is that the result of your foreach is a mix of empty lists and a!saves. You will need to remove the empty lists from your result.
so you mean i still can put a!save inside a!forEach loops right? Just empty list is problem
Yes
Write your forEach() inside the value parameter of a!save() if business logic allows. That way, you can still return empty list for your forEach() and there wont be any errors.