You might need in some cases an equivalent of a “custom entity”: we got you covered 😉
If you are in need of matching part of a user response, and store it as a specific value, we can help you.
Let’s say for example you want to be able to match order references: no worry, we are going to explain you how to do that.
In the step where you ask your user for a reference, go into the “then” configuration section at the bottom of your step, click on “Add condition” and select IF “User response” “Matches Regex”:
Good; we are now going to build a Regex, and use the Named Capturing Groups to save match into a Session Value.
In our imaginary case, the order reference is always composed of 2 letters followed by 5 digits. The Regex should then be:
\w{2}\d{5}
To have a better understanding on how to create Regex, you can follow this dedicated tutorial.
Now, adding capturing group, and imagining the user could introduce his reference with some text:
.*?(\w{2}\d{5})
And finally, transforming the Capturing Group into a Named Capturing Group:
.*?(?P<order_ref>\w{2}\d{5})
Et voilà! The mach will be then recorded and accessible in
{{@session.order_ref}}
in next step 😊