Skip to main content
Solved

Get value of parent node instead of expanding to children


rory.smith
TimeXtender Xpert
Forum|alt.badge.img+7

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": [
                    {
                        "ids": [
                            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)?

 

Best answer by rory.smith

Hi,

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

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+1
  • Contributor
  • 25 replies
  • November 4, 2024

Hello Rory,

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

 

Kind regards,

Benny Aalders


rory.smith
TimeXtender Xpert
Forum|alt.badge.img+7
  • Author
  • TimeXtender Xpert
  • 649 replies
  • Answer
  • November 4, 2024

Hi,

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings