Assigning inputs
RCS can be a powerful tool to collect data from your customers. In this article, we’ll discuss how to collect this data for use in your RCS conversations.
Assigning an input
To assign an input, open the Advanced panel and go to the Input Config panel. Click + Add assignment.
You’ll see the following fields:
- Next State: Choose which message will come next in the sequence, after the end user responds with the input. You can choose a view you’ve already created, or enter the name of a view that you will create later.
- Required toggle: Mark this input as required.
- From: Here, you’ll add a token that represents the data you are collecting. See collection tokens to learn more.
- To: Here, you’ll give your a collection field a name. You can use this field name to return the information later in the RCS conversation.
- Min length: Set a minimum number of characters the response must meet. If the user does not meet the min length requirements, the following error will be returned:
Value must be no more than
${rules.maxLength}characters
- Max length: Set a maximum number of characters for your user’s response. If the user exceeds the max length requirements, the following error will be returned:
Value must be at least
${rules.minLength}characters
- Regex pattern: Include a regex pattern for the input. If the regex pattern is not met, the user will receive the following error message:
Value does not match required pattern
Collection tokens
String data
When a user responds to your message with free text, you can record it using the token:
currentMessage.text
This will record as a string value in the field name you have given it.
Later, you can add this string to your messages in the form of a dynamic token formatted as the below:
{{ context.FIELDNAME }}
Tip: Looking for a demo? Our data collection walkthrough provides step-by-step instructions on collecting user inputs.
Location data
One of the built-in suggestions for RCS allows the user to seamlessly provide location data with your RCS agent. When you’d like to collect location data, you can record it using the token:
currentMessage.location
This will collect the user's location as data. When referring to this data later, you can use the token:
{{ context.data.FIELDNAME }}
Tip: Looking for a demo? Our Create dynamic cards walkthrough provides step-by-step instructions on using a user’s location to search for nearby locations.
Updated about 2 months ago