We are currently performing maintenance on Appian Community. As a result, discussions posts and replies are temporarily unavailable. We appreciate your patience.

reject function used with index function

Certified Senior Developer

How can we fetch only not null cases from this index function.

pls share the detailed query

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I prefer to avoid "reject()" and the other primitive looping functions where possible (which is almost everywhere), as a!forEach() does a better job, is more flexible, and is easier to understand.  Here we iterate over an array of "local!activeTasks" (pulling out arbitrary property "myProperty" first using the property() rule, which does the same thing as index() but we're using the appropriate one for the job it's doing here).  When any given iteration is blank, the loop returns an empty set.  (We wrap the whole thing in a!flatten() since otherwise if every iteration returns an empty set, it would give you an array of empty sets, which a!flatten() collapses to the desired single empty set).

    a!flatten(
      a!forEach(
        property(local!activeTasks, "myProperty", null()),
        if(
          a!isNotNullOrEmpty(fv!item),
          fv!item,
          {}
        )
      )
    )

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    actully data is coming from a task report.

    out of which i need to filter that report data based on the value of a field

  • 0
    Certified Senior Developer
    in reply to om786

    You are already using Query analytics to show it on the grid (You got the list here), Use Chaitanya's or Mike's Suggestion to index only the Notnull values out of the list. Did you stuck somewhere?? You want list of active tasks from local!activetasks where "C26" field is not null?? 

  • 0
    Certified Senior Developer
    in reply to venkat Avuluri

    yes i need the records which dont have the null vales at c26 column of task report.

    i tried the chataniya suggest but it didnt work.

    i want  list of active tasks from local!activetasks where "C26" field is not null

Reply Children