Update a response using Actions Tab or Webservice option in Survey Flow

Nico_LeussinkNico_Leussink Enschede, NetherlandsCommunity Member, Qualtrics Brand Admin Qubie ✭
edited March 26 in Best Practices

Update a response using Actions Tab or Webservice option in Survey Flow

Hello,

I have a survey wich contains two steps. In the first step a new respondent is answering all questions. In the Survey Flow an Embedded Data Field is added called 'sts'. This field remains empty after the first step. After finishing an emailtrigger sends a message to another person. This emailmessage contains a retake link from the response and is set to not delete the original respons. This retakelink looks like:

https://mycompany.qualtrics.com/jfe/form/SV_1aBCd2EF3ghIJ4K?Q_R=R_X1Y2Z3k4l5m67NO&Q_R_DEL=0

Now the survey starts based on this retakelink. In the original response I want the Embedded Data Field 'sts' be filled with some info, like 'xyz'. But I can't get it to work. Below some screenshots:
In the Actions Tab I have set the event to 'All types'. No conditions is set. The task is set up to:

After I ran the retakelink, no data is changed in the original response. The field 'sts' remains empty.

I also tried Web Services in the Survey Flow section. Below the screenshot of the settings I used:

But when I click on the Test button I receive an errormessage: 404 - Not Found, The requested resource does not exist.

Can somebody help me setting up either option to amend the Embedded Data Field in the original response?

Kind regards and thanks in advance.

Nico Leussink

Best Answer

  • KeirJKeirJ Community Member, Qualtrics Brand Admin Guru ✭✭
    edited December 2019 Accepted Answer

    Hi @Nico_Leussink!

    You're on the right track with the Web Service but the configuration is missing a couple of pieces.

    The Update Response API documentation shows that two parameters are required (In addition to including the response ID in the URL, as you have done already):

    1) surveyId
    2) embeddedData

    To add these to your Web Service block, you'll want to set it the 'Body Parameters' section as seen below. According to the documentation, the 'embeddedData' parameter is structured as a JSON object, so that's why it has the curly braces around the content (e.g., {"sts": "Test"}.

    I also recommend capturing the HTTP response variables as you can see in the 'Embedded Data' section of the Web Service block. These will capture the HTTP response from when the Web Service fires and store it on the survey response that triggered the Web Service. This can be useful for troubleshooting purposes. Below, you can see what this looks like in the response data.

    I hope that helps!

Answers

  • Nico_LeussinkNico_Leussink Enschede, NetherlandsCommunity Member, Qualtrics Brand Admin Qubie ✭

    Thank you @KeirJ. This helped me a lot, it's working now in my environment.

  • Rod_PestellRod_Pestell Hemel HempsteadCommunity Member Guru ✭✭

    Hi @KeirJ,


    Just came across your post and wondered if this might help me with what I'm trying to do. I don't want to retake the survey in question but want to make an amendment to a question based on the followup data of a ticket. I can setup an action which if any of the followup data changes can result in a task which can update the ticket data. This works fine. But what I also need is to be able to align the response data in the original survey. This is a specific field which is about the type of feedback the response is about (eg. Complaint / General or Compliment). If this is possible, would you be kind enough to walk me through the steps to make this happen? From your post above I don't quite understand whether I need only to use the Web service request Task (the first picture) or whether I need to do something in the survey flow (a web service block in the survey flow). I understand the need to add some system based embedded fields for trouble shooting purposes.


    I don't really know much about APIs, JSON, POST and GET etc. but hopefully what I am trying to do is feasible and so can pick it up as I go.

    Thanks in advance


    Rod Pestell

  • Rod_PestellRod_Pestell Hemel HempsteadCommunity Member Guru ✭✭

    Hi @Nico_Leussink ,


    KierJ hasn't responded so I was wondering if you could kindly help me setup a similar action for my survey. Could you help with some guidance and the questions I had as per my post above?


    Many thanks in advance


    Rod Pestell

  • Nico_LeussinkNico_Leussink Enschede, NetherlandsCommunity Member, Qualtrics Brand Admin Qubie ✭

    Hi @Rod_Pestell,

    Of course I can try to help you. As fas as I know you can only add/amend Embedded Data Fields.

    I have created a short survey where you can test if this is what you want. A few things you need to change:

    1. Create a new survey from file and use the attached survey-file.
    2. Navigate to your account setings, click on Qualtrics IDs and find your API token. Copy this API token. Check the Qualtrics support page for more details: www.qualtrics.com/support/integrations/api-integration/overview
    3. Open the new created survey, navigate to Survey Flow, scroll down to the Web Service element, delete the fake X-API-TOKEN and paste your own X-API-TOKEN.
    4. In the URL address bar you can copy your SurveyID now and paste this into the field containing a fake surveyID now.
    5. Save this Survey Flow

    Now test this survey. You have to give in your own Email address because I have added an Emailtrigger. The content of the email contains a socalled 'Retake link' where I have changed the last part of this link from 1 to 0. This means at Retake you will keep the original response. Make a selection and send the response.

    You will now receive an email with this retake-link. Click on this link in your email. Notice that your previous choise is still the selected choise now. Now press on the button to go to the next page. Now select one of the options to change the content of the embedded data field sts. Now press on the Next button. You will receive an email again containing a retake link. But also please check the Data & Analysis tab as well and notice that the embedded data field 'sts' is changed.


    Hope this helps you futher. If not, please contact me.

  • Rod_PestellRod_Pestell Hemel HempsteadCommunity Member Guru ✭✭

    Hi @Nico_Leussink ,


    Thanks very much for the reply and the guidance. That's been really helpful. Together with Qualtrics support I've been able to get to where I want which is to use the Action/Task version of the Web Service. So when I make a change to a field in the follow-up section of a ticket, it will now update the entry in the survey.


    I will come back shortly on this thread and share my process and settings in more detail as I'd think many other people are trying to figure out how to do this.


    As you mention the only drawback is that it will only change embedded fields and not actual QID based answers. However, I'm thinking it might be possible as I know API can be used to edit these responses (so long as they haven't been edited manually!) as we got a 3rd party company to tidy up some data for us a little while back (convert dates from UK to US format). So it must be possible - the caveat I recall though is that the method used meant you had to record all responses (GET) and post them all back up again including the edited ones at the same time. If you didn't do it this way, you'd lose any data points you didn't include. Perhaps this is a little too programmatic heavy for this simple task to handle but worth investigating.


    I'll be back shortly :)


    Thanks again! 😊


    Rod Pestell

  • Rod_PestellRod_Pestell Hemel HempsteadCommunity Member Guru ✭✭

    hi @Nico_Leussink / All,


    Just wanted to add an update on this as I've got stuck. as above I had managed to get a webservice task from within a ticket action working effectively. However, the solution I'm currently using will only do one field of embeddeddata field change at a time. I'm sure it can do more than one and it's just the JSON syntax I'm struggling with. Please see the pic attached. I've included two EmbeddedData fields


    as soon as I save it though the 1st of the 2 embeddedData fields is lost

    Can you or anyone advise when using this webservice task (from within the event based actions part of the system how you can do more than one embeddedData field at a time?


    Thanks


    Rod Pestell

  • Rod_PestellRod_Pestell Hemel HempsteadCommunity Member Guru ✭✭

    HI All,


    I think I solved it it was a simple comma!! {"field1":"value1", "field2":"value2"}. Doesn't anyone know using this JSON route as to whether there is a limit on the length of the JSON string?


    Also, this is a No auth[icator] method but I still have to provide my API token, Survey and Response ID.... so would you regard this as still secure? Is this PUT command only allowable as I'm logged in with credentials?


    Thanks

    Rod Pestell

Sign In to Comment