I am in the process of creating numerous JSON files for a project, sourced from Google Spreadsheets. By utilizing data-drive npm package, I acquire JSON data that has a specific structure:
{
"custom_id": 1,
"another_thing": "pizza",
"step_1_message": "msg",
"step_1_hint": "hint",
"step_1_intent": "intent",
"step_2_message": "msg",
"step_2_hint": "hint",
"step_2_intent": "intent"
}
However, I aim to restructure the data so that each step is encapsulated within its own object. The desired format would be:
{
"custom_id": 1,
"another_thing": "pizza",
"steps": [
{"step_id": 1, "message": "msg", hint: "hint", "intent": "intent"},
{"step_id": 2, "message": "msg", hint: "hint", "intent": "intent"}
]
}