Counting word in a text string inputted by the user

Hello,

I’m creating my frist bot and i want to count how many words are in a text string inputted by the user. So, when the user writes more than 4 words, flow must go to „Node1“. When the user writes less than 4 words flow goes to „Node2“ and so on.

Could you please help me how to implement this

Thanks!

Hi and welcome to the community,

You have two options:

  1. Use an action to parse event.preview and put a value in temp, so it can be used in a node transition

  2. Since the requirement is simple, you can directly have it in the transition condition something like:

    event.preview.split(' ').length > 4
    

E.g.:

1 Like