Skip to main content
June 14, 2024
Question

How to remove empty list of dictionary from the list of varient

  • June 14, 2024
  • 3 replies
  • 0 views

Hi,

Please find attached screenshot.

How to remove the list of dictionary with size 'o'

3 replies

stefanhelzle0001
June 14, 2024

You could use the filter() or reject() function in conjunction with my universal null checker expression described here: https://appian.rocks/2022/10/17/the-magic-of-null-checking/

June 14, 2024

You can try by checking the key length. See the sample code for reference:

a!localVariables(
  local!data: {
    { id: 1, name: "Mobile" },
    { id: 2, name: "Laptop" },
    {}
  },
  local!filteredData: a!forEach(
    items: local!data,
    expression: if(length(a!keys(fv!item)) = 0, {}, fv!item)
  ),
  local!filteredData  
)

mikes0011
Brainy
June 14, 2024

Wrap in a!flatten()