Skip to main content
Question

Find solution to single out value from description with indexof until new line (\r\n)


Forum|alt.badge.img+5

Hi,

I’ve build a solution for a customer with help of workflow automations (WFA) in Freshservice. The WFA is parsing text from the description field and it’s purpose it to single out a username after the key word “Bruker: “

 

I have an working solution that uses substring and index of expression fucntions in conjunction. The customer now wonders if it’s possible to take the user name from the first key word to a line break (\r\n). I’ve tested the below but it doesn’t seem to solve it for me. Can Freshservice distinguish line breaks or do I need to use regexmatch. Anyone have any examples for this?

substring('{{ticket.description}}', (indexOf('{{ticket.description}}','Bruker: ', 0)+8), indexOf('{{ticket.description}}','\r\n',0))

 

The above is supposed to take efterthing from “Bruker: “ to the first line break, but it doesn’t work and throws this error message:

/Erik Alm

 

 

Output - Operator 'substring' : Third operand's value must be > second operand's value.
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+11
  • Skilled Expert
  • 89 replies
  • November 6, 2024

I have historically and continue to occasionally experience this in our environment as well; not frequent enough for me or anyone to be bothered by it but frequent enough for me to now post this update :)

 

Sometimes the same expression can give different error outputs as well:

 

During my testing I too tried to get it to go to a specific line following a line break but it doesn’t appear to be able to ‘see’ line breaks at all, even though other types of formatting do present issues for these conditional expressions when processing the Description field content!


Roxwell
Contributor
Forum|alt.badge.img+9
  • Contributor
  • 225 replies
  • November 6, 2024

I find expressions really fiddly

 

does {{ticket.description | split: "Bruker: " | last}}  work for you?


Reply