Use JavaScript in workflow to change stored data? | XM Community
Skip to main content

Use JavaScript in workflow to change stored data?

  • February 8, 2023
  • 2 replies
  • 74 views

Forum|alt.badge.img

Hi,
Is it possible to use JavaScript in a workflow to change stored data? I am passing participants from a main survey to a gift card survey and our IRB requires that no identifying info is passed from the main survey to the gift card one. However, I want to prevent users from passing the gift card survey around to people who haven't taken the main survey. (I have RelevantID, etc. turned on -- I'd like something specific than that.)
My solution is to create a random number with embedded data and pass that to the gift card survey in the URL. That works, but Qualtrics stores the number with the first survey, too, which I can't have because of my IRB restrictions. My solution is to use a workflow to set that value to 0 after the first survey is submitted, but I can't figure out how to do it.
Is this possible? And if so, can you please provide a code snippet to show how to set an embedded variable? Thank you!

2 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • February 9, 2023

I think you need to use the API to update responses from a workflow.


Forum|alt.badge.img
  • Author
  • February 10, 2023

Good to know -- thanks, Tom!