Skip to main content
June 14, 2023
Question

Remove array from Array List

  • June 14, 2023
  • 2 replies
  • 0 views

I have a dropdown where you can select a date, the follow code is for the choiceLabels:

if(
    and(
        local!prefijo.prefijo = "listasis",
        a!isNotNullOrEmpty(local!prefijo.idTipoAsamblea_int),
        and(
            local!prefijo.idTipoAsamblea_int <> 2,
            local!prefijo.idTipoAsamblea_int <> 4,
            local!prefijo.idTipoAsamblea_int <> 6
            )
        ),
        union(
            text( index(local!fechaPorSerie , "fechaAsamblea", null ), "dd/MM/YYYY hh:mm a"),
            text( index(local!fechaPorSerie , "fechaAsamblea", null ), "dd/MM/YYYY hh:mm a"),
          ),
        union(
            text( local!fechasDeAsamblea, "dd/MM/YYYY hh:mm a" ),
            text( local!fechasDeAsamblea, "dd/MM/YYYY hh:mm a" ),
          )
)


If I have 18 dates, but 2 dates are the same... the array is goint to be 18.

But the array has a variable called idAsamblea, so every date has a different idAsamblea.

The follow code is for choiceValues:

if(
    and(
      local!prefijo.prefijo = "listasis",
      a!isNotNullOrEmpty(local!prefijo.idTipoAsamblea_int),
      and(
        local!prefijo.idTipoAsamblea_int <> 2,
        local!prefijo.idTipoAsamblea_int <> 4,
        local!prefijo.idTipoAsamblea_int <> 6
        )
    ),
    union(
          index(local!fechaPorSerie, "idAsamblea", null ),
          index(local!fechaPorSerie, "idAsamblea", null )
        ),
    union(
          indeX( local!Asamblea,  "idAsamblea", null ),
          indeX( local!Asamblea,  "idAsamblea", null ),
                                 
        )
    )


I want to remove the array duplicated and just leave one array with its date and idAsamblea.

    2 replies

    mathieud0001
    Brainy
    June 14, 2023

    So from what I can gather, you have 2 identical dates with different ids.

    {id: 1, date: 2023-06-14}

    {id: 2, date: 2023-06-14}

    Suppose that we do remove the duplicate from the choiceLabels list and we choose that date in the list, which of the 2 ids above would you choose to save in the value?

    harshitb6843
    June 15, 2023

    Which 'idAsamblea' out of all for the matching date should it consider?