ForEach Expression Rule not returning list as desired. Please advise.

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

Parents Reply
  • Hello,

    The reason why you are getting 2 values. Is because you are looping SelectedApprovalTeams, which actually has 2 values.

    The reason to get null values is that the rule NSA_GetStatusOfApprovalTeam_ExprRule each time is not returning pending, consequently it goes to the falseValue of the “ir function” which has null value.

    That is definitely a normal behavior. You can use Carlos suggestion on the reject or filter, or pass {} instead of null and use flatten.

    José
Children
No Data