Below is the expression rule.
a!forEach( items: ri!NSARequest.SelectedApprovalTeams, expression: { if(rule!NSA_GetStatusOfApprovalTeam_ExprRule(ri!NSARequest, fv!item) = "Pending", fv!item, null) } )
Rule Input Value being passed in Test Case:
{ AAGRequest: {Status: "Pending"}, OGCRequest: {Status: "Completed"}, SelectedApprovalTeams: { cons!NSA_AAG_Name_Cons, cons!NSA_OGC_Name_Cons }}
It is returning null and count 2 even if the input list passed has only one "Pending" status request.
List of Variant: 2 items List of Text String: 1 item "Architecture Assurance Group" List of Text String: 1 item null (Text)
Discussion posts and replies are publicly visible
It's not clear what you're asking.
If you want to return the following, just get rid of the curly braces following expression in the a!foreach loop.
a!foreach
List of Text String: 2 items "AAGRequest" null (Text)
If you want to get rid of the null entry, clean up the resulting list using something like reject(fn!isnull, local!list).
reject(fn!isnull, local!list)