Scheduled Task For each loop workflow | XM Community
Question

Scheduled Task For each loop workflow

  • 21 July 2022
  • 2 replies
  • 130 views

Userlevel 5
Badge +11

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!
image.png
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


2 replies

Userlevel 7
Badge +27

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.

Userlevel 5
Badge +11

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

Leave a Reply