0

I need to split the input of the conversation on different variables:

I send the message Name|Lastname|+549111122222, when I receive the incoming Conversation in Studio Flow, I need to split the data in three variables (name, lastname and phone)

First, I created a Set Variables widget with the key input and the value {{trigger.conversation.Body | split: '|'}}.

enter image description here

When I execute the flow, the result is not an array but a string without the '|' characters:

"input": {
  "input": "DiegoROMERO+561111444444"
}

I would expect this:

"input": {
  "input": ["Diego","ROMERO","+561111444444"]
}

What am I doing wrong?

1 Answers1

0

This happens because all variable are of datatype string, i.e. the array will be casted to a string when it's saved as a variable.

From what I can tell, you have two options.

  1. Store name, lastname, and phone in three different variables.
  2. Move the entire logic from a "studio variable" into a liquid variable.
IObert
  • 2,118
  • 1
  • 10
  • 17