CONCATENATE - combining answers through survey flow | XM Community
Solved

CONCATENATE - combining answers through survey flow

  • 17 April 2019
  • 7 replies
  • 349 views

Badge +3
Hi!

Has anyone tried to combine answers from different (open ended) fields into one data field, for reporting purposes?

In excel I would use "CONCATENATE" and I was wondering if this would work from survey flow as well.

The situation is, that for various reasons, we would have e.g. 3 fields of open ended (form) questions, that would need to be kept separate in the form. However, I would like to create a word cloud out of all of the responses. How can I concatenate the answers into one variable through survey flow? Or what would better serve this purpose?

The new, combined variable should be usable in Vocalize.
icon

Best answer by SaurabhPujare_Ugam 17 April 2019, 15:10

View original

7 replies

Userlevel 6
Badge +18
Hi Helena,
1. Create an embedded variable say "CombineText"
2. In values click on blue down arrow and select insert piped text and from the question from the list select the form entry option that you need.
3. !

4. Do this for all other option by appending the later options to first.
5. Your embedded variable will look something like this:
6. !
7. !
Userlevel 4
Badge +21
Nice! =CONCATENATE is such a useful formula for spreadsheets.
Badge +3
Thank you! This will be very helpful for us!
As a follow up to the thread above, I would like to concatenate two fields via survey flow for reporting purposes and add a comma and space between them. Right now the output appears as LastNameFirstName. I would like the output to read: LastName, FirstName.
Userlevel 5
Badge +11

What will happen is you eg. concatenate 3 fields but one of them is blank? eg. 3 Answers but the 2nd one is left blank. I suspect you'll get a double comma appearing? ie. Answer1,,Answer3. Is there something that can be done to replace the double comma ,, with just one comma? Might this be some JS code?

Thanks

Rod Pestell

Badge +3

Hi, Rod.
If you don't have a JS solution, a series of branches may be another option.
Using the CombinedText embedded field example from SaurabhPujare_Ugam's suggestion...

In your survey flow, create a branch with multiple IF criteria:
Answer 1 is not blank AND
Answer 2 is not blank AND
Answer 3 is not blank
Then CombinedText = Answer 1, Answer 2, Answer 3

Create another branch with the next combination of IF criteria:
Answer 1 is blank AND
Answer 2 is not blank AND
Answer 3 is not blank
Then CombinedText = Answer 2, Answer 3

Create another branch with the next combination of IF criteria:
Answer 2 is blank AND
Answer 1 is not blank AND
Answer 3 is not blank
Then CombinedText = Answer 1, Answer 3

Create another branch with the next combination of IF criteria:
Answer 3 is blank AND
Answer 1 is not blank AND
Answer 2 is not blank
Then CombinedText = Answer 1, Answer 2

Keep adding branches to address combinations of blanks or missing data.

Userlevel 5
Badge +11

Thanks brmckim, pretty complex if you have 20 options but it's a solution so thanks for the reply.

Leave a Reply