JSON format: getting survey structure data | XM Community
Skip to main content
Hello



Complete beginner here, so sorry if I don't use appropriate terminology.



I am starting out getting responses with API, and have a question about multiple choice/loop questions.

How do you work with this data in JSON Path to extract data? For example, my actual survey:



`{

"result": {

"id": "SomeIDNumber",

"questions": {

"QID1": {

"questionName": "Q1",

},

"QID2": {

"questionText": "Please Chose your options (all fields are required)",

"questionName": "Q2",

"choices": {

"1": {

"recode": "1",

"choiceText": "MB50001",

"imageDescription": null,

"variableName": null,

"analyze": true

},

"2": {

"recode": "2",

"choiceText": "MB50002",

"imageDescription": null,

"variableName": null,

"analyze": true

},

"3": {

"recode": "3",

"choiceText": "MB50003",

"imageDescription": null,

"variableName": null,

"analyze": true

}

}`



I want to extract the information in 'recode' and 'choiceText', so I have a library of recode and ChoiceText pairs for responses when they are extracted as numbers. Though I don't know how to do that. I searched for JSON path syntax, but it seems my survey file is structured differently than normal. When I download the survey structure in JSON through API, each loop is its own entity to choice, not an element array within choice. So instead of this structure (Sample from online instructions):





`{ "store": {

"book": [

{ "category": "reference",

"author": "Nigel Rees",

"title": "Sayings of the Century",

"price": 8.95

},

{ "category": "fiction",

"author": "Evelyn Waugh",

"title": "Sword of Honour",

"price": 12.99

}

],`



I get this structure:



`{ "store": {

"book1":

{ "category": "reference",

"author": "Nigel Rees",

"title": "Sayings of the Century",

"price": 8.95

},

"book2":

{ "category": "fiction",

"author": "Evelyn Waugh",

"title": "Sword of Honour",

"price": 12.99

}

}`



Which means instead of using index options to extract data, I have to have different paths for each loop/multiple choice and repeat it many times over.

It also affects response results. I assume everyone who uses JSON to get Qualtrics data has to deal with this. So how does this work? Can anyone help me with json path syntax?



Thank you,



Milly
Sorry, never tried this one...



However, you can reach out to Qualtrics support team and ask for the API help, I am sure one of the API specialists will help you.



Follow below link to reach out to support team. The better option is to call them...

https://www.qualtrics.com/support-center/?Product=survey-platform

Leave a Reply