Consume API and response
Question

Hi, first post and new OutSystems user (although experience in DEV, Outsystems is new to me, and I've been through the training etc...)

I have consumed an API taking data from GCP using standard SQL, the API has responded and given me the output, typically Outsystems would put this data into a structure that can be used in a form, other other element, but I'm struggling to utilise the data (I've mocked data, but to give you an idea)

The Rest API output is below, could you offers suggestion on how to get this into a structure of Test1-4 in a structure so I can drag/drop the elements onto a page, thanks in advance.


{

  "kind": "myQueryfromAPI",

  "schema": {

    "fields": [

      {

        "name": "f0_",

        "type": "RECORD",

        "mode": "NULLABLE",

        "fields": [

          {

            "name": "TEST_ONE",

            "type": "STRING",

            "mode": "NULLABLE"

          },

          {

            "name": "TEST_TWO",

            "type": "STRING",

            "mode": "NULLABLE"

          },

          {

            "name": "TEST_THREE",

            "type": "STRING",

            "mode": "NULLABLE"

          },

          {

            "name": "TEST_FOUR",

            "type": "STRING",

            "mode": "NULLABLE"

          }

        ]

      }

    ]

  },

  "jobReference": {

    "projectId": "test",

    "jobId": "test",

    "location": "test"

  },

  "totalRows": "4",

  "rows": [

    {

      "f": [

        {

          "v": {

            "f": [

              {

                "v": "01"

              },

              {

                "v": "02"

              },

              {

                "v": "03"

              },

              {

                "v": "04"

              }

            ]

          }

        }

      ]

    },

    {

      "f": [

        {

          "v": {

            "f": [

              {

                "v": "2"

              },

              {

                "v": "3"

              },

              {

                "v": "4"

              },

              {

                "v": "5"

              }

            ]

          }

        }

      ]

    },

    {

      "f": [

        {

          "v": {

            "f": [

              {

                "v": "7"

              },

              {

                "v": "3"

              },

              {

                "v": "4"

              },

              {

                "v": "5"

              }

            ]

          }

        }

      ]

    },

    {

      "f": [

        {

          "v": {

            "f": [

              {

                "v": "yes"

              },

              {

                "v": "no"

              },

              {

                "v": "up"

              },

              {

                "v": "down"

              }

            ]

          }

        }

      ]

    }

  ],

  "totalBytesProcessed": "0",

  "jobComplete": true,

  "cacheHit": true


}

mvp_badge
MVP

Hello JaKaLi

Welcome, what kind of application you build? (reactive, traditional, mobile)

This information helps with answers.

 Kind Regards.

Hi, apologies, its a traditional Web application, 

Hello JaKaLi,

Have you tried creating a structure using the option stated below:


It will automatically generate the desired Structure for you out of the JSON you will paste in the text box.


Hope this helps!

Regards,
Nikhil

Hi, yes I've done that but I get a very heavily nested structure, with the responses in an array inside a single 'v' cell,

I'm after

TEST1  TEST2 TEST3  TEST4

01         02        03        04 etc etc etc...


As my structure, or a sub structure inside outsystems, below is my structure generated.


Hi all, still chasing a solution if anyone can advise, thanks again.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.