Transforming arrays into an array

Options

Hi there!

I have [ [{a}], [{b}], [{c}] ]

I need [ {a}, {b}, {c} ]

Any ideas?

Thanks!

Best Answer

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Answer ✓
    Options

    Assuming a value x that contains [[{a}], [{b}], [{c}]]:

    create value output = [] (empty array)

    For each x as item

    add to end of array - array: x value: item.0 (this will extract the first item in the array, turning [{a}] into {a})

    stop and debug value:output


    That should confirm output contains the shape you are looking for!


    If you are facing more of this class of issue, data transform questions are a pretty common topic in our daily State Change Pro office hours. We get people over them pretty quickly!

Answers