Hi All,
I need to loop through various responses and the ticket connected to the response (1 ticket per response and the ticket ID is included as an embedded field within the response) and change some data. I've thought of some ways to do this but am stuck on at different points of each of them...
1) an update response API call via a survey response task. I don't know what is meant by this and how I invoke it. I'm guessing you have to apply a flag to all the responses you want to edit but then what do you do? Do you have to run an external PUT or POST API command that then makes a change to each response ID that I want changing or what? Or, do you just change one entry via API and it will process all responses altered - somehow??... I've drawn a blank on the support pages so hoping someone can help!
2) By using a scheduled task within Qualtrics and a for each loop, where I import a data file via SFTP which has all the response IDs and ticket IDs and labels I want to change. I thought I was onto something here but it turns out that when you use a data importer (eg SFTP) you are restricted to using some specific data loaders, namely XM directory or B2B or the likes. Qualtrics support have said you can't use an Update ticket task via a for loop task and pip text from the uploaded data to it. Is this true - has anyone found a work around?
3) By using JavaScript alone. I've done some tests using the API Urls to edit ticket data and assume it is just as easy to update response (embedded) data - I've always done my edits via a webservice you see). The bit I'm stuck with is finding a template that will help me work out how to load the data and do a for each loop.
To be honest I would be much better and confident by doing this in VBA from wiithin excel as then I could easily loop through a range of cells. Has anyone done such API work from within excel and could they possibly provide a good simple template that I could use - one that posts but also manages the response you get.
I'm not after finished code, just some topline examples or guidance. I'm ok in VBA (but self taught) whilst JavaScript is more difficult as I don't have a debug tool to tell me I've missed a semicolon for example (!).
Hope someone can help
Thanks
Rod Pestell
Hi Rod_Pestell ,
So i can help you with response Update API how that works.
Every Survey response has a unique response ID. So Update Response API allows you to update a response's embedded data's. Please note though it updates 1 response at a time. If you want to update multiple responses you need to write some code or use some program to run the API in loop to update multiple responses from a data file.
Hi NiC
Thanks for the reply. I've progressed the Excel VBA route for changing Ticket data which although was a little slow (1 ticket every 2 seconds) did the job and importantly confirmed if each one had worked correctly. So the VBA route is a good solution. That said it is only for embedded data fields or ticket data and not updating response data but there are not too many occasions where I've needed to change response data (ie not embedded data).
I did also join the preview about the new generic email received task which could be used to post data to a workflow that could then decipher the body of the email and take that data to make the necessary changes (again embedded data only though I suspect via a webservice). This would be more for adhoc changes or for team members without VBA knowledge. I'm still working on this as this would require Javascript / code task to decipher the body of the email and take all the information and then maybe respond back to the sender via email confirming that the change has been made. Not progressed this much but it's an idea that might allow me to pass on some adhoc admin work on the data.
Someone else (in another thread of mine) did also come up with an idea to prepare the data to change an import it into a temporary survey (imported data) and then run a workflow on it - I need to change out what type of task will operate when you import data as the screenshot above only seems to talk about new create responses or API updated responses - not responses / response data that has been imported via a csv file or something.
Thanks
Rod Pestell
Hi All,
I’m just circling back on this question as I’ve managed to make use of the new Loop feature in a scheduled work flow task (see pic below). I’ve managed to use a CSV file saved on my SFTP account and cycle through the Id’s in the file and use a webservice task that can push some changes to a field in the imported data project / table. This is great... however, I’ve noticed that the recorded date is updated and very similar to when updating embedded fields in a survey response, I want to keep the recorded date the same.
In the extract of the data the fields I noticed it is labelled up as: ‘_recordedDate (+01:00 GMT)’ however I’ve tried a number of different variations of this field and referenced the original recorded date in the file but it fails saying it can’t find the field.
When you edit an embedded field of a survey response via API / a webservice there is an option ‘resetRecordedDate = false’ but again this doesn’t work.
In the webservice, the URL I’m using is
https://fra1.qualtrics.com/API/v3/imported-data-projects/<SourceID>/records/${datasource://Extract data from SFTP files/id}?nonDestructive=true
with the headers:
Content-Type
X-API-TOKEN
Keys (all set to string)
DateCreated_DT
id
On it’s own, it works but I must try to keep the recorded date the same. Is there any work around for this for an IDP (Imported data project)?
Thanks
Rod Pestell
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.