Passing values using global variable | XM Community
Skip to main content
Solved

Passing values using global variable

  • June 11, 2020
  • 14 replies
  • 40 views

Forum|alt.badge.img+1

my requirement is as follows:

  1. User selects a value from a dropdown list

  2. In case dropdown doesn't include value matching to user's needs he/she can include one thru a free text questions.

  3. I want to display the final selection by user on subsequesnt pages.

so if user chooses a predefined value from dropdown then display this or if he defines his own value in the textbox than display this.

any suggestions will be greatly apreciated.

Best answer by bmcgrath

This can be done in the survey flow with one branch and an embedded data field. You can create an embedded data field and set it equal to the drop down selection. And then branch if the user's open text entry is not empty; within that branch, set your embedded data field equal to their open ended response instead.

14 replies

Forum|alt.badge.img+3
  • Level 2 ●●
  • Answer
  • June 11, 2020

This can be done in the survey flow with one branch and an embedded data field. You can create an embedded data field and set it equal to the drop down selection. And then branch if the user's open text entry is not empty; within that branch, set your embedded data field equal to their open ended response instead.


Forum|alt.badge.img+1
  • Author
  • June 11, 2020

thanks bmcgrath for your response.
how do i display the final selection as a piped text for example in a matrix type
image.png


Forum|alt.badge.img+3
  • Level 2 ●●
  • June 11, 2020

If you click on Scale Point 6, you can choose Insert Piped Text, Embedded Data Field, and then choose the Embedded Data Field you created in the survey flow. Or type ${e://Field/ed} but replace 'ed' with your Embedded Data Field's name.


Forum|alt.badge.img+1
  • Author
  • June 11, 2020

thanks bmcgrath
unfortunately its not allowing me to set the value of embedded data field from a text box


Forum|alt.badge.img+3
  • Level 2 ●●
  • June 11, 2020

You don't have a menu that looks like this for your scale point label?
image.png


Forum|alt.badge.img+1
  • Author
  • June 11, 2020

my embedded data field is displayed but not getting selected somehow


Forum|alt.badge.img+3
  • Level 2 ●●
  • June 11, 2020

If I understand what you're saying, maybe just try typing ${e://Field/ed} for your scale point, but replacing 'ed' with your Embedded Data field.


Forum|alt.badge.img+1
  • Author
  • June 11, 2020

bmcgrath you are amazing. i think i got what i needed.. many thanks :)


Forum|alt.badge.img+1
  • Author
  • June 11, 2020

bmcgrath Can i not add branches under ToC?

It looks like i cannot add embedded data under Table of content


Forum|alt.badge.img+3
  • Level 2 ●●
  • June 11, 2020

I've never used a ToC before actually, so I'm not sure how much I can help with that. If you're talking about the same use case, I would assume the question with the drop-downs would come after the ToC, so I'm not sure how you'd want to display the ToC based on that question. But if it's for something else, it looks like you can define embedded data fields before the ToC is presented in the survey flow and you can even have a ToC display within a branch (so you could have different ToC's for different embedded data fields); but I don't know what fields that would be referring to because it wouldn't be able to pull from a future question. And. again, I am not speaking from experience on the ToC part.


Forum|alt.badge.img+1
  • Author
  • June 11, 2020

i have only one embedded data field which is calculated based on the conditions i specified in my initial post.
can we compute embedded data field thru if-then-else condition?


Forum|alt.badge.img+3
  • Level 2 ●●
  • June 11, 2020

But what will come first in the survey? The question with the dropdown that determines the embedded data value or the ToC.


Forum|alt.badge.img+1
  • Author
  • June 11, 2020

ToC because the block with dropdown is part of overall survey


Forum|alt.badge.img+3
  • Level 2 ●●
  • June 11, 2020

In that case the Embedded Data Field won't be populated when the ToC is showing up, so you wouldn't be able to do anything with it.