Split syntax

Release date: 23 July 2024

In some cases, API responses may return lengthy strings, however, you might only require a portion of that string for a specific use case. Previously, it was not possible to extract only a specific portion of the string in Chat Flow and other workarounds had to be used to solve this use case. With this release, we've introduced a Split Syntax feature that enables flow-builders to split variables based on a specified character, allowing for efficient extraction and use of relevant data subsets.

For example, if an API returns the full address,100 Edward Street, Bo Oakdale, Cape Town, 7530, South Africa”, the flow-builder can use the correct split syntax command and retrieve only the subset of the string they want to use, e.g., "100 Edward Street, Bellville".

Read here for more details.

Example of extracting different parts of a long string using a specific split syntax command.

The table below shows some more examples of using this feature to extract different parts of a string.

Command structure: <value>:<delimiter>:<position1>:<position2>

Which part do you want?Split syntax commandOutput

Extract only the first portion of the address.

[[100 Edward Road, Bo Oakdale, Cape Town, 7530, South Africa:, :0]]

100 Edward Road

Extract only the last portion of the address.

[[100 Edward Road, Bo Oakdale, Cape Town, 7530, South Africa:, :-1]]

South Africa

Extract parts 1 to 3 of the address.

[[100 Edward Road, Bo Oakdale, Cape Town, 7530, South Africa:, :1:3]]

Bo Oakdale, Cape Town, 7530

Last updated

Logo

© Copyright 2024 Clickatell. All rights reserved.