Deleting a response post-submission | XM Community

Deleting a response post-submission

  • 25 February 2021
  • 15 replies
  • 169 views

Userlevel 1

Hello,
In my survey the participant is asked what they would like to be called, and this is used across other questions and blocks. Is there a way to delete the answer to this question at the end of the survey so that it would not show up in the data analysis/reports later? The idea is to keep respondents anonymous once they are finished.
Thanks,
Chris.


15 replies

Userlevel 7
Badge +56

Hi Chris2124 : you should be able to delete the question from your survey (so it does not gather responses). When using StatsIQ to analyze responses, you can choose not to analyze data from that question, and when exporting responses, you can choose not to export responses to that question to your data file. Also be sure to choose "Anonymize Responses" from the survey options menu, so that you do not capture IP addresses. I hope that helps!

Userlevel 1

Hi AdamK12, thanks for your response. All of these are helpful, and I may have to resort to using one of your solutions, but my concern is that the participant's name will be linked to their answers even for a short amount of time which would go against my ethics. Ideally, the response would be automatically deleted before I am able to look at it myself. Is this possible?

Thanks,
Chris.

Userlevel 7
Badge +56

Chris2124 I'm curious how you are planning to analyze the data. If you don't want to have any view of the names, you can do the following:

  1. In the Data and Analysis tab, choose "Tools", then "Choose Columns," then uncheck the column that you don't want to see. Then you won't see the names at all when you click on the data and analysis tab.

  2. When you go into Stats IQ, you may see the column name but if you don't run any analysis on it, you won't see it.

  3. When you export data, the same principle applies -- you will see the column name, but when you export data just make sure the column name (e.g., attribute) isn't checked, and it won't show up in your file or in your export via the Web connector.

Does anyone else have suggestions for Chris?

Userlevel 1

Hi AdamK12 thanks for replying so quickly. I'm going to be exporting the data and analyse it in R. The main issue here is around ethics, less so practicality. They need to enter their name for part of the experiment, but ideally it would be deleted so I have no access to it at all.

Thanks,
Chris.

Userlevel 7
Badge +56

Chris2124 That makes sense--if you do it in any of those ways, you shouldn't have access to any of the personal information like their name. Just curious -- is this a situation where they are asked to provide their name for another business purpose, but in your research role, you need it to be de-identified? You should be able to do the export without ever "touching" or seeing the names.

Userlevel 1

AdamK12 I appreciate the solutions, however I think they would not get through an ethics board as at some point in the process their name will be linked with their questionnaire answers (despite me choosing to delete or not use it). The context is a survey where their name is used to make it feel more personable (for research) and then I'm trying to find a way for it to be deleted automatically when they complete the survey.

Userlevel 7
Badge +56

Chris2124 --that makes total sense. I escalated this hoping that someone else will see it who has dealt with that issue--I'm not sure how to delete a response after it's recorded. There may be a macro or algorithm that you can use. Any other suggestions from the community?

Userlevel 7
Badge +21

There is one workaround which you can use for this. It relies on the feature/bug that if you repeat a block in the survey flow, only the last answer is recorded and not the earlier ones. It's not deleting, its overwriting.
I haven't tested it yet, but the flow would be something like this:

  1. Create an embedded variable called
    placeholder
    . Keep it empty.

  2. Create a question for the name/email id, keep it as the only question in the block. Set it's default value to be equal to embedded variable
    placeholder
    .

  3. Add javascript to this question to hide the question and instantly click the next button. Use a condition to trigger the hiding and next click only when
    placeholder
    is not empty.

  4. Towards the end of your survey, set the value of
    placeholder 
    to some random value.

  5. Display the block again in the survey flow.

Now, when you'll look at your survey data, you'll only get the final value, i.e, the random string you set at the end.
Points to note, since you plan to use the name at different places in the survey, it may show up in the data/pdf files as part of the question text or whereever else you use it. I also do not know whether you can access this data in the surveys in progress, since its not overwritten, its possible that the name is visible prior to that.
Here's the JS you can use for this:
Qualtrics.SurveyEngine.addOnload(function () {
    let random_value = "${e://Field/placeholder}";
    let quest = this;
    if (random_value != "") {
        quest.getQuestionContainer().hide();
        var qid = this.questionId;
        quest.getQuestionContainer().querySelector("#QR\\\\~" + qid).value = random_value;
        quest.clickNextButton();
    }
});

Userlevel 7
Badge +56

Ahmed Thanks for chiming in -- this seems to be what Chris2124 is looking for!

Userlevel 3
Badge +3

ahmedA
Can this work for a text entry question where I have asked for an email Id. In my scenario, I would like the email to be deleted after I send a report to the respondent via an email trigger. I must not save the respondent email id due to GDPR .

Badge

Psarma facing the same challenge. Since the email is only triggered on completion of the survey, the code posted by ahmedA unfortunately won't do the trick. Did you end up finding a solution? Thanks!

Badge +7

You can pretty easily send a name or email to a second survey as embedded data, where it can be erased after use in the second survey by reassigning another value to it. (No need to reshow a block.) Technically, the value will still show when inspecting a survey response in the editor on the receiving survey, but the passed parameter is not available for download on the receiving survey, doesn't show in the data editor there, and can't be used in a report.

Userlevel 7
Badge +21

https://community.qualtrics.com/XMcommunity/discussion/comment/43239#Comment_43239I'm sorry, but this would create problems for a lot of people.
Values, even if not visible currently visible in the dataset, can be accessed later by creating EDs for them in the survey flow.
So in your solution, it will only appear as if the email id is not stored. If you do not overwrite it, it will be available.

Badge +7

Good point, you can't really overwrite that data, normally, when it is riding in on a query. You can change the flow to get it back, just as you can add embedded data to the flow after the survey is closed and it will still show in results (so long as it is on the contact list). Just using data does a pretty good job of hiding those values, but you can still see them (in all cases) by viewing the preview for the record. Changing the values in the flow just keeps them out of downloads and reports. I could not get your javascript to work.

Badge +7

https://community.qualtrics.com/XMcommunity/discussion/comment/43250#Comment_43250That's incorrect, the data are most certainly not available, unless the second embedded data step (the step that resets the data) is removed. It shows in a case view, just as you say your proposed solution would. I tested my solution. Could you test your proposed solution? I'm not a JS programmer. I have inserted javascript into questions or blocks many times, for instance to display calendars for date entry (there are several JS programs for this), but I could not get your code to work. I imagine if it did work, there would probably be a flash on the screen as the data are displayed and deleted? I got errors from your code. Thank you.

Leave a Reply