JS Script to display a block based on previous block display ? | XM Community
Skip to main content
Hello,

I have a question regarding JavaScript. I'm a total beginner with it but I really need to get something done for the survey I'm working on at the moment.

- I use a loop and merge study, there are 4 blocks (A, B, C, D)

- participants are randomly assigned to either A, B, C, D "type loops" and read related arguments

- after reading a fixed number of statements they can chose either to stop or to continue reading

My question is:

- IF they choose to read more, how can I implement in the survey flow or JS a condition/rule saying that: "If they were in condition "A type loops" ; then they will be exposed again to "A(next) type loops" ?

I tried without success with embedded data, and could not find solutions up to now.

I'd be extremely grateful for future advice ! :-)



Just in case, here is the script used for "first" A-Type:

Qualtrics.SurveyEngine.addOnload(function()



{

// Track page load

var PageLoad = 1;

Qualtrics.SurveyEngine.setEmbeddedData('condition', PageLoad);



});
On another block you can add display logic where your condition will be if loop and merge equation to A and they selected to continue reading , this block should be seen.



Or more simply instead of creating another block add within loop and merge block and on these questions apply filter to be shown if selected continue reading.
Thanks for your answer @bansalpeeyush29

I'll try what you said!

Leave a Reply