Nesting?
Closed this issue · 4 comments
I'm trying to create this format:
{
name: "Interaction",
userSays: [
"Hello",
"Hi"
],
responses: [
{
type: "text",
elements: ["Hi, how are you", "Hello! What can I do for you?"]
}
]
}
This is my sheet
https://docs.google.com/spreadsheets/d/1egdQFcCgXPa-iSvcQYzuDBqWXmDhYgmov5NiLDqMwm4/edit?usp=sharing
I think I have what you are looking for:
{
"Sheet1": [
{
"name": "Interaction",
"userSays": [
"Hello",
"Hi"
],
"responses": [
{
"type": "text",
"elements": [
"Hi",
"how are you",
"Hello! What can I do for you?"
]
}
]
},
{
"name": "Secon Interaction",
"userSays": [
"one",
"two",
"three"
],
"responses": [
{
"type": "text",
"elements": [
"four",
"five",
"six"
]
}
]
}
]
}
I got that with the following sheet:
Sheet name: NA_Sheet1
name | JA_userSays | [responses]{#type} | [responses]{#type}JA_elements |
---|---|---|---|
Interaction | Hello, Hi | text | Hi, how are you, Hello! What can I do for you? |
Secon Interaction | one, two, three | text | four, five, six |
With Nested Elements, Array Prefix, and Nested Array Prefix enabled.
Thanks for taking a look. I'm getting this error message
TypeError: Cannot set property 'elements' of undefined
at exportSpreadsheetJson (ExportSheetData:1802:58)
at exportJson (ExportSheetData:889:5)
at GS_INTERNAL_top_function_call.gs:1:8
https://docs.google.com/spreadsheets/d/1egdQFcCgXPa-iSvcQYzuDBqWXmDhYgmov5NiLDqMwm4/edit?usp=sharing
Looks like the keys are missing the #
. Your key path should be:
[responses]{#type}
Not:
[responses]{type}
Thak you - that was it. Appreciate the assist