Use this Split Action to evaluate a sequence of values separated by a space ( ), period (.) or plus sign (+).

As an example, you might record the birth of a child by soliciting messages in the following format:

"birth [gender]+[name]+[mother's birth year]," which could yield the result "birth f+Noel+1985"

In the case above, the term "birth" acts as a keyword trigger, initiating the flow.

To create a flow that collects and evaluates a sequence of values:

  1. Click the "gear" icon in the flow editor and select the "Edit" option in the drop-down menu to create the "birth" keyword trigger that will direct messages to this flow. 

2. Begin the flow by creating a Wait for Response Split Action with an open-ended response rule to collect messages directed to this flow via the "birth" keyword trigger. Save the result as "Message."

Note: This split step must remain open-ended, as it will collect all messages that contain the keyword we've designated, "birth". Once we've stripped the initial message of its keyword, we can go about evaluating each field using a series of Split by Flow Result actions.

3a. Remove the keyword trigger to isolate the submission as the flow variable @results.message (Split by Flow Result actions may only evaluate flow variables). To do so, create a node that splits the initial message by expression. In the example pictured below, we apply the @(REMOVE_FIRST_WORD()) function to the incoming message (referenced using @input.text). The resulting expression should read @(REMOVE_FIRST_WORD(input.text)).

3b. Save the resulting flow variable as "Fields" to yield only the values delimited by a plus sign. To review, the values we'll submit will follow the format [gender]+[name]+[mother's birth year]. Each bracket value is assigned its own field. Gender is the first field, Name the second and (mother's) Birth Year the third.

4. Add a Split by Flow Result action to evaluate Gender, the first field delimited by a plus sign. Create a response rule for each gender that categorizes the short form values "m" or "f" as their long form counterparts, and save the resulting flow variable as "Gender." 

Note that to delimit the result, you must click on the "Advanced" tab and check the delimit box. 


After you've checked the delimit box, you can fill out your response rules:

5. Add a Send an SMS response action that addresses incorrectly formatted "Gender" values and asks the contact to resubmit the message.

In the example pictured above, we've formatted the error message to repeat the contact's initial message using the @results.gender variable, so they can see how their response compares to the expected format, and ask them to resubmit.

6. Add a second Split by Message Form action to evaluate Name, the second field delimited by a plus. This time, it's the name of the child. You can create an is not empty response rule to ensure the second field has a value, then categorize it as as you wish and save the resulting flow variable as "Name."

7. Add a Send a Message action that addresses incorrectly formatted "Name" values and asks the contact to resubmit.

8. Add a third Split by Flow Result action to evaluate Birth Year, the third field delimited by a plus. Add a has a number between response rule to ensure the third field contains a valid birth year and save the resulting flow variable as "Birth Year".

9. Add a Send a Message action that addresses invalid "Birth Year" values and asks the contact to resubmit.

10. Finish the flow by adding a Send a Message action that confirms the message form submission by referencing the values submitted by the contact.


The resulting flow should look similar to the example pictured below.

Need more than nine fields? Use the Split by Flow Result action and the following function: 

@FIELD(text, index, [delimiter])

Reference a field in a string separated by a delimiter:

@FIELD("hello world", 2, " ")

 

Did this answer your question?