Syntax question - Embedded Data Math Operation in JS | XM Community
Skip to main content
Question

Syntax question - Embedded Data Math Operation in JS

  • April 6, 2020
  • 1 reply
  • 10 views

Forum|alt.badge.img+5

Hi all,
I'm trying to set some embedded data using javascript that uses a math operation. It doesn't seem to be working, I'm presuming my syntax is incorrect. Could anyone point me in the right direction?
Three variants of what I've tried are below. Many thanks!

Qualtrics.SurveyEngine.setEmbeddedData( '${e://Field/Total%20Permanent%20Staff}', '$e{q://QID75/ChoiceNumericEntryValue/1/1 + q://QID75/ChoiceNumericEntryValue/1/2 + q://QID75/ChoiceNumericEntryValue/1/3}' );

Qualtrics.SurveyEngine.setEmbeddedData( 'Total%20Permanent%20Staff', '$e{q://QID75/ChoiceNumericEntryValue/1/1 + q://QID75/ChoiceNumericEntryValue/1/2 + q://QID75/ChoiceNumericEntryValue/1/3}' );

Qualtrics.SurveyEngine.setEmbeddedData( 'Total Permanent Staff', '$e{q://QID75/ChoiceNumericEntryValue/1/1 + q://QID75/ChoiceNumericEntryValue/1/2 + q://QID75/ChoiceNumericEntryValue/1/3}' );

1 reply

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • April 6, 2020

Add a space after $e{ and a space before }