How I can create array with objects

I have an information from Google Sheets like that:
image

It isn’ an array, but I want create and array from this info (screenshoot), to look like that:

[
   {
      "value": courses.name(B), // B from table
      "sort": Row number // Row number from table
   },
   {
      "value": courses.name(B), // B from table
      "sort": Row number // Row number from table
   },
   {
      "value": courses.name(B), // B from table
      "sort": Row number // Row number from table
   },
]

I will be grateful for any help.

hi @pplanejane

You can use the ‘Aggregate to JSON’ component in the ‘JSON’ module.

Within that component, you first create a data structure:

Then you configure the component to put the course name in field value, and the row number in field sort:

After running the scenario, the output of the Aggregate to JSON component should yield the correct JSON string:

2 Likes

Thank you for helping, it’s working!

3 Likes