index and where contains not working in process model

Hi,

have created one rule which called from process model. but it does not return any value.

need to filter values from pv.

The rule has index and where contains

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    It can be .. if where contains is returning list of integers - 0 items (the data which you are trying to find is not present in the array) ... hence the index function is not returning any value
    please look at this code

    a!localVariables(
      local!data:{a!map(id:1,data:"aman")},
      local!data2:{"a","b","c"},
      index(local!data2,wherecontains(2,local!data.id),null)
    ) //id:2 is not present in the data and 
       // the where contains will return list of number integers 0 items
       //code will goes as
        //  index(local!data2,tointeger({}),null)
        //   which will return list of text string 0 items


Reply
  • 0
    Certified Associate Developer

    It can be .. if where contains is returning list of integers - 0 items (the data which you are trying to find is not present in the array) ... hence the index function is not returning any value
    please look at this code

    a!localVariables(
      local!data:{a!map(id:1,data:"aman")},
      local!data2:{"a","b","c"},
      index(local!data2,wherecontains(2,local!data.id),null)
    ) //id:2 is not present in the data and 
       // the where contains will return list of number integers 0 items
       //code will goes as
        //  index(local!data2,tointeger({}),null)
        //   which will return list of text string 0 items


Children
No Data