Remove empty Empty List of Variant

Certified Associate Developer

Hello everyone! Is there a way to get rid of empty lists? I attempted to use `reject(a!isNullorEmpty, RESULT)`, but I encountered the following error: (Image 2).

Image 2

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    By any chance did you try reject( fn!isnull, Result) ??

  • 0
    Certified Lead Developer
    in reply to rahulb0007

    Try with this (from localtmp to the end , replace the name of your list)

    a!localVariables(
    local!inputArray: {1,2,3,4,5,6,7,8,9,10,"","","",""},
    local!totalArray: length(local!inputArray),
    local!maximumPerArray: 5,

    local!amountArrays: ceiling(local!totalArray / local!maximumPerArray),
    local!iterationArray: enumerate(local!amountArrays),
    local!res:
    a!forEach(
    items: local!iterationArray,
    expression: with(
    local!leftAmountToCut: fv!item * local!maximumPerArray,
    local!rightAmountToCut: local!totalArray - ((fv!item + 1) * local!maximumPerArray),

    rdrop(
    ldrop(
    local!inputArray,
    local!leftAmountToCut
    ),
    if(local!rightAmountToCut < 0, 0, local!rightAmountToCut)
    )
    )
    ),

    local!tmp:
    a!forEach(
    items: local!res,
    /*expression: if(count(reject(fn!isnull,union(fv!item, fv!item)))>0, union(fv!item, fv!item),null)*/
    expression: count(reject(fn!isnull,union(fv!item, fv!item)))>0
    ),

    index(local!res, wherecontains(true, local!tmp))

    )

Reply
  • 0
    Certified Lead Developer
    in reply to rahulb0007

    Try with this (from localtmp to the end , replace the name of your list)

    a!localVariables(
    local!inputArray: {1,2,3,4,5,6,7,8,9,10,"","","",""},
    local!totalArray: length(local!inputArray),
    local!maximumPerArray: 5,

    local!amountArrays: ceiling(local!totalArray / local!maximumPerArray),
    local!iterationArray: enumerate(local!amountArrays),
    local!res:
    a!forEach(
    items: local!iterationArray,
    expression: with(
    local!leftAmountToCut: fv!item * local!maximumPerArray,
    local!rightAmountToCut: local!totalArray - ((fv!item + 1) * local!maximumPerArray),

    rdrop(
    ldrop(
    local!inputArray,
    local!leftAmountToCut
    ),
    if(local!rightAmountToCut < 0, 0, local!rightAmountToCut)
    )
    )
    ),

    local!tmp:
    a!forEach(
    items: local!res,
    /*expression: if(count(reject(fn!isnull,union(fv!item, fv!item)))>0, union(fv!item, fv!item),null)*/
    expression: count(reject(fn!isnull,union(fv!item, fv!item)))>0
    ),

    index(local!res, wherecontains(true, local!tmp))

    )

Children
No Data