Extracting value from a JSON object inside nested loop of unknown iteration

Hi, I am trying to extract the values corresponding to all ‘QuestionId’ and ‘QuestionText’ from the below JSON response . The issue that I’m facing is that they are in multiple levels of the nested loop. Also, the below JSON nesting may vary every time and go till unknown iterations. Can someone please guide me how to do this?
P.S. I tried de-serialize JSON but I’m unable to figure things out post the first ‘QuestionId’ and ‘Questiontext’.

{“getQuestionsResponse”: {“decisionTree”: {
“Name”: “Siblings”,
“Status”: “NOT_DEFINED”,
“Question”: {
“QuestionId”: “565582”,
“QuestionText”: “Brother’s age”,
“QuestionType”: “NUMERIC”,
“branches”: {“branch”: [
{
“branchValue”: “0”,
“branchText”: “0”,
“Question”: {
“QuestionId”: “565583”,
“QuestionText”: “Sister’s age”,
“QuestionType”: “NUMERIC”,
“branches”: {“branch”: [
{
“branchValue”: “0”,
“branchText”: “0”,
“selected”: “0”
},
{
“branchValue”: “20”,
“branchText”: “20”,
“selected”: “0”
}
]}
},
“selected”: “0”
},
{
“branchValue”: “1”,
“branchText”: “1”,
“Question”: {
“QuestionId”: “565586”,
“QuestionText”: “Sister’s age”,
“QuestionType”: “NUMERIC”,
“branches”: {“branch”: [
{
“branchValue”: “0”,
“branchText”: “0”,
“selected”: “0”
},
{
“branchValue”: “20”,
“branchText”: “20”,
“selected”: “0”
}
]}
},
“selected”: “0”
},
{
“branchValue”: “20”,
“branchText”: “20”,
“Question”: {
“QuestionId”: “565589”,
“QuestionText”: “Sister’s age”,
“QuestionType”: “NUMERIC”,
“branches”: {“branch”: [
{
“branchValue”: “0”,
“branchText”: “0”,
“selected”: “0”
},
{
“branchValue”: “20”,
“branchText”: “20”,
“selected”: “0”
}
]}
},
“selected”: “0”
},
{
“branchValue”: “30”,
“branchText”: “30”,
“Question”: {
“QuestionId”: “565592”,
“QuestionText”: “Sister’s age”,
“QuestionType”: “NUMERIC”,
“branches”: {“branch”: [
{
“branchValue”: “0”,
“branchText”: “0”,
“selected”: “0”
},
{
“branchValue”: “20”,
“branchText”: “20”,
“selected”: “0”
},
{
“branchValue”: “30”,
“branchText”: “30”,
“selected”: “0”
}
]}
},
“selected”: “0”
}
]}
}
}}}

Any help is highly appreciated

@devbitun don’t worry - you’ll be a pro in no time :slight_smile:

Here is a sample workflow that pulls assets from the orchestrator followed by a deserialize activity and some more activities to put the data into a dataTable. I know this might not solve your problem but I hope this helps with the deserialize JSON bit.

getOrchestratorAssets.xaml (13.1 KB)

Thanks @Mr_Meeseeks for your help. This gives me an idea - I’m getting into it!