String manipulations are not possible via the regular operations and adding javascript in questions is not available for free accounts. That's why you don't see the option to add custom JS.
You can look at adding the code with the
script
tags in the header of your survey, that may work. However, you'll some extra logic to ensure that your embedded variables do not get overwritten.
Thanks Ahmed for your prompt response! Any reference how to add tags in header? Does this need custom JS?
https://www.qualtrics.com/community/discussion/comment/33152#Comment_33152That's a different question from what's mentioned in the title. So, I'd suggest asking a new question with as much details as you can provide and accepting the answer if the solution worked for you. This will allow other people to find answers more easily.
Sure! I can create a new thread. Does this option also need custom JS?
You can look at adding the code with the
script
tags in the header of your survey, that may work.
Don't create a new thread, I misunderstood your question about tags. Sorry. My fault. Suppose you want to use the JS code from the link in your initial question. So, this is how you'd go about it. Go to your header and select source. Ref:
There you add a script tag, with . So, the final thing should look like:
Just be careful, because the problem is that this code will get executed on every page. So, if you are manipulating the questions and all, it may mess up some others also. However, if you are just going to store the data, then it shouldn't be a problem.
Thanks for the steps! I tried the same but seems like header is not getting saved. I am not able to verify that, every time I open the header after saving it reset to Blank.How will I ensure the code gets executed? Would this create an embedded variable a that can be used in data and analysis section?