Passing values using global variable | XM Community
Solved

Passing values using global variable


Userlevel 2
Badge +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.

icon

Best answer by bmcgrath 11 June 2020, 15:53

View original

14 replies

Userlevel 2
Badge +3

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.

Userlevel 2
Badge +1

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

Userlevel 2
Badge +3

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.

Userlevel 2
Badge +1

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

Userlevel 2
Badge +3

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

Userlevel 2
Badge +1

my embedded data field is displayed but not getting selected somehow

Userlevel 2
Badge +3

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.

Userlevel 2
Badge +1

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

Userlevel 2
Badge +1

bmcgrath Can i not add branches under ToC?

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

Userlevel 2
Badge +3

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.

Userlevel 2
Badge +1

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?

Userlevel 2
Badge +3

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

Userlevel 2
Badge +1

ToC because the block with dropdown is part of overall survey

Userlevel 2
Badge +3

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.

Leave a Reply