How to get position of '/' in a text using glidefunction:position() and then use it in substring

ghulesanket
Tera Contributor

Hi,

 

I want to get the position of '/' in a text using the glidefunction:position().And then want to use it in substring.

Tried to escape the value but it returns error/garbage value. I cannot use other javascript functions because only basic functions are included in reports.

Code:

glidefunction:substring(category,'0',position('/',category))

Eg. I have string - 'Network Services / VPN / Cloud'

       So after the code execution I want to display only - 'Network Services'

 

How can we do this ? Thanks in Advance 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@ghulesanket 

try this

glidefunction:substring(category, '1', glidefunction:subtract(position('/', category), '1'))

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Thank you @Ankur Bawiskar the solution worked for me.