Has anyone else noticed a change in how the wherecontains function works? S

Certified Associate Developer
Has anyone else noticed a change in how the wherecontains function works?
Specifically if I am searching for repeated values the wherecontains now removes duplicates from the results where it used not to.
Eg:
wherecontains({a, b, a}, {a, b, c})
I expect this to return [1, 2, 1] however it now returns [1, 2].

If this is the desired behavior does anyone know how I might get the first result (IE: [1, 2, 1]) short of using an apply function? (I'm manipulating large arrays and I'd prefer to use a set function instead of an iterative one)...

OriginalPostID-128856

OriginalPostID-128856

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer
    Very interesting - That goes against my experience as I've used it extensively in 6.5, 6.6 and 6.7 and it's never removed duplicate results from the result set before.

    My use case is that I have a large list of Id's and I need to get a corresponding object for each ID. Because there are only ~30 objects and they live in the database I wanted to use the wherecontains and index function to transpose the ids into the objects via:

    index(objectArray, wherecontains(keyList, objectArray.Id), null())

    I've used this successfully in many situations and have even created an expression rule to use this recipe in shorthand.
Reply
  • 0
    Certified Associate Developer
    Very interesting - That goes against my experience as I've used it extensively in 6.5, 6.6 and 6.7 and it's never removed duplicate results from the result set before.

    My use case is that I have a large list of Id's and I need to get a corresponding object for each ID. Because there are only ~30 objects and they live in the database I wanted to use the wherecontains and index function to transpose the ids into the objects via:

    index(objectArray, wherecontains(keyList, objectArray.Id), null())

    I've used this successfully in many situations and have even created an expression rule to use this recipe in shorthand.
Children
No Data