Can I write javascript in the embedded data? | XM Community
Skip to main content

I need to ask Qualtircs to random generate integers within a range but all integers appear in a equal probability. If I use the the web-service: set embedded data->custom value->insert pip text->random number, the probability of each integer appearing is not equal. I am wondering if I can write my own java code to generate?
Or I just want to know, how can I achieve this: generate integers within a range in embedded data, and each integer appears in equal chance?
Thanks a lot!!!!!

You can use Math.random().


Can I write javascript in the embedded data?Thanks Tom! My difficulty is actually, how can I write the js in embedded data. I did not find the option to insert my own code in the embedded data block. Could you share me some guides?


You can't run JS from the survey flow. The survey flow is server side, and JS is client side. If you are looking for an alternative way to generate random numbers in the survey flow, write your own web service script to do it.


Can I write javascript in the embedded data?can I do that as an individual user? or I need to buy any license?


You need a web server to host the script.


Can I write javascript in the embedded data?after that, how can I put it in the embedded fields? insert pip text->opt out link?
Thanks!


Leave a Reply