I want filter out data from my data set array on basis of any like condition ? (reject function)

I want filter out data from my data set array on basis of any like condition ?

 

Can i use reject function for that ? but how i will do this as its accepting first parameter as function.

reject(fn!isnull, {1, null, 3})

reject("*test*",local!dataset.fieldName) - Syntext might be incorrect but i want something like this

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to phanthomas27

    For what it's worth, filter() can now basically be completely replaced with a!forEach() (just like apply() and most other looping functions other than reduce()).  I recommend this approach in general because the coding of a!forEach() is a lot easier to understand both while initially creating logic, as well as for those who need to come around later and figure out what the original developer did.

    a!localVariables(
      local!entries: {"gerd", "german", "manfred", "freddy"},
      local!searchTerm: "man",
      
      a!forEach(
        local!entries,
        if(
          like(fv!item, "*" & local!searchTerm & "*"),
          fv!item,
          {}
        )
      )
    )