Autocoding Verbatim Responses | XM Community
Skip to main content
Does anyone have experience implementing autocoding for verbatim responses in Qualtrics (by auto coding, I mean giving the tool a list of acceptable verbatim answers that'll essentially automatically code verbatims into a hidden multi-choice question)?
This is definitely possible with some JavaScript. I'll see what I can work out soon!
Hi Rachel,

Not sure what you mean...but my gut is telling me I would solve this with a contact list. Do you want different "verbatims" to be unique based on the respondents? Do you want them to show as multiple choice options? Like in a drop down?
Thanks, @AnthonyR. I used to do a bit of python coding on the back end of my old tool for this, but wasn't sure if there was something already implemented/a known solve here yet.



@MartyK Nothing would be showing to the participants. It's more of a back-end bucketing thing... takes some of the work out of hand-coding responses, if that makes sense?
The attached gist will work for you if you are using a multiline or essay text box. Just add this javascript to the question. It will save the results in Embedded Data rather than a hidden question as that is best practice.



https://gist.github.com/mattbloomfield/fac63be414cbd4ed13839b2f62740cce



You will need to add your regex to the regex variable, as it is currently looking for 'my text string' or 'my other text string'.



Additionally, you would want to change the `fieldName` variable to whatever you were hoping to code. Obviously you could expand this for use with multiple terms.



The `.match()` function in javascript returns an array of matches, so you could even look through those and tag multiple embedded data fields instead of just one.

Leave a Reply