export-responses and questionIds, embeddedDataIds not returning only named columns | XM Community
Solved

export-responses and questionIds, embeddedDataIds not returning only named columns

  • 15 October 2020
  • 2 replies
  • 167 views

Badge +3

I am using the export-responses API call to return a data set. The documentation lists questionIds and embeddedDataIds as options to include in the data portion of the body. The documentation states, 'If provided, only export answers from the provided list of Question IDs'. My expectation is to get a data set with the metadata and only those columns listed. However, the data set is the same as if I specified nothing. Here is the call I have tried (and other variations). I also have tried specifying the format as json but the same dataset is returned.
 downloadRequestResponse = requests.request("POST","https://co1.qualtrics.com/API/v3/surveys/SV_xxxxxxxxxx/export-responses/"
, json=data, headers=headers, verify=True)
 data = {
 "format": "csv",
       "seenUnansweredRecode": 2,
       "newlineReplacement":" ",
       "breakoutSets": True,
        "questionIds":["QID1"],
       "limit":5
     }
I have also tried replacing "questionIds": ["QID1"] with "embeddedDataIds":["emb1","emb2"]
I have verified the ids in the survey definition.
What am I missing?

icon

Best answer by JS_its 30 April 2021, 21:02

View original

2 replies

Badge +3

I think I finally figured it out! Part of the issue was working with data sets with many fields which made it difficult to see what was really happening.
Basically, you have to specify all 3 field types in the data.
{
embeddedDataIds: [],
surveyMetadataIds:[],
questionIds:[]
}
If the parameter is not specified it will return all fields of that type.
So, if you want an export of only the ResponseId, RecordedDate and an embeddedField:
data = {"embeddedDataIds":["emb_field"],
"surveyMetadataIds":['"_recordId","recordedDate"],
"questionIds:[]
}

Badge +3

Hi,
I'm using python script to download data and it's not including Survey metadata and embedded data. Could you share the code snippet for this please.

Thank you!

Leave a Reply