Convert array to json

Options
AgIQ
AgIQ Member
edited August 2023 in ? Transforming data

Hi, I have an array and I would like to transform that into a typical json payload. Any suggestions? It comes from an api call, csv_encode step.

Comments

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

    What we are looking at is JSON. Perhaps you wanted a more specific representation? Do you mean you want to refactor this into an array of objects, using the first row as the keys, and then mapping to the values repeatedly?

  • AgIQ
    AgIQ Member
    Options

    Hi Ray, Thanks for your willingness to help. I think this just shows my lack of programming terminology 😂
    I wanted the data to be is a format like this:

    I got the video from support and it does exactly what I was looking for (using the csv_decode part)