cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Extract part of string?

Nmatan
Deputy Chef I
Deputy Chef I

Hi all,

New to Workato.

I have a requirement to extract the first 500 characters of a string, I tried to do this with a formula but for some reason it's not working:

String.scan(/.{0,500})

The regex seems to be correct, but the end result is empty - not posting anything.

What am I doing wrong?

Appreciate any help!

1 REPLY 1

mppowe
Executive Chef I
Executive Chef I

Hi Nmata, what about .slice?  Like

<your variable>.slice(0,500) 

Or if you need to protect against nulls

<your variable>&.slice(0,500)