cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
308
Views
2
Helpful
5
Replies

String parsing in Webex Flow Designer

rbroersma
Level 1
Level 1

Hello,

Looking for some help on parsing a string in webex contact center flow designer.  I have a string variable that looks something like this..

xxxxxxxxx;yyyyyyyyyy

I'm trying to parse the string to just get the values prior to the ';' (so all the x's).  

I'm using the following formula in my set node but it's failing (vVariable is the variable described above)....

{{substring(vVariable, 0, (indexOf(';',vVariable)-1))}}

Thanks for any help.

Ryan

1 Accepted Solution

Accepted Solutions

gkovanis
Cisco Employee
Cisco Employee

Hello @rbroersma ,

Using pebble, you can use a function similar to the below to retrieve what you want:

{{vVariable | split(';') | first }}


 

View solution in original post

5 Replies 5

If this is for WebexCC, wouldn't you use a function like slice in pebble to get you what you want?

gkovanis
Cisco Employee
Cisco Employee

Hello @rbroersma ,

Using pebble, you can use a function similar to the below to retrieve what you want:

{{vVariable | split(';') | first }}


 

wajidhassan
Level 4
Level 4

Hi @rbroersma ,

In Webex Flow Designer, the correct syntax for indexOf is indexOf(vVariable, ';') (variable first, then the character). Also, to include all characters before the semicolon, you don't need to subtract 1.

Try this instead:

{{substring(vVariable, 0, indexOf(vVariable, ';'))}}

This will extract everything before the semicolon.

Hope this helps!

rbroersma
Level 1
Level 1

Thanks for the help everyone.  I was able to use the suggest pebble syntax as well as create a javascript function.

Do you want to post it here in case it helps someone else?