Skip to main content

I am trying to achieve something complex in the TX REST connector using table flattening.

I have the following JSON response:

 

>
    {
        "id": 1,
        "submitted": "2024-06-26T12:11:42+02:00",
        "answers":
            {
                "question": {
                    "id": 3,
                    "label": "How do you evaluate this?",
                    "type": "SINGLE"
                },
                "answer": 9
            },
            {
                "question": {
                    "id": 4,
                    "label": "How do you rate the following elements?",
                    "type": "MATRIX_SINGLE_CHOICE"
                },
                "answer": m
                    {
                        "ids": E
                            55
                        ],
                        "labels": Â
                            "Drinks"
                        ],
                        "value": /
                            "Good"
                        ]
                    },
                    {
                        "ids": Â
                            56
                        ],
                        "labels":  
                            "Food"
                        ],
                        "value": >
                            "Good"
                        ]
                    }
                ]
            }
        ]
    }
]

 

So my response has an answers array which contains both a question array and an answer that is sometimes a direct value and sometimes an array. How can I create a flattening that directly reads a parent node without expanding the child nodes (ids, lables,value)?

 

Hello Rory,

Could you expand on the desired output? What would you like to see as a result?

 

Kind regards,

Benny Aalders


Hi,

I cannot exactly remember how I managed to solve this and would need to look it up.


Reply