I’m building a scenario that obtains data from cells within a single column in Google Sheets, correctly formats the data into JSON, then sends an HTTP POST request into a Discord channel. I’ve tried using the following modules. Set A Variable, Aggregate/Parse to JSON, Text Aggregator but can’t seem to find the correct way to structure the data how I want it.
My desired outcome is to have a single json string which includes key:value pairs.
for example :
[
{
“1”: null,
“2”: “Academia”,
“3”: “english book (short story)”
etc…
}
]
Google Sheets Input
[
{
"tq": "select A",
"from": "drive",
"limit": 19,
"select": "list",
"sheetId": 0,
"spreadsheetId": "/"
}
]
Google Sheets Output
[
{
"0": null,
"__IMTLENGTH__": 19,
"__IMTINDEX__": 1
},
{
"0": "Academia",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 2
},
{
"0": "english book (short story)",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 3
},
{
"0": "english textbook",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 4
},
{
"0": "english tv series",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 5
},
{
"0": "spanish book (novel)",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 6
},
{
"0": "french language app",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 7
},
{
"0": "french online tutor lesson",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 8
},
{
"0": "french podcast",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 9
},
{
"0": "french videos",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 10
},
{
"0": "korean book (novel)",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 11
},
{
"0": "korean flashcards/videos",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 12
},
{
"0": "korean textbook",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 13
},
{
"0": "italian language app",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 14
},
{
"0": "italian review",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 15
},
{
"0": "japanese review",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 16
},
{
"0": "japanese book (graded reader)",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 17
},
{
"0": "portuguese book (novel)",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 18
},
{
"0": "portuguese textbook",
"__IMTLENGTH__": 19,
"__IMTINDEX__": 19
}
]
Set Variable Input (total of 19 times but only showing the first 3)
[
{
"name": "1",
"scope": "roundtrip",
"value": null
}
]
[
{
"name": "2",
"scope": "roundtrip",
"value": "Academia"
}
]
[
{
"name": "3",
"scope": "roundtrip",
"value": "english book (short story)"
}
]
Set Variable Output (total of 19 times but only showing the first 3)
[
{
"1": null
}
]
[
{
"2": "Academia"
}
]
[
{
"3": "english book (short story)"
}
]