Workflow Of the Week - Session 6 - Liquid Filters to extract information from from a ticket's subject and inject them into fields

  • 30 September 2021
  • 4 replies
  • 1186 views

Userlevel 7
Badge +9

Workflow of the Week is a recurring series that will showcase all things workflow, such as use cases, enhancements, tips, and tricks.

 

In this week’s session, check out how to use liquid filters to extract information from a ticket’s subject and inject them into fields.

 

Useful Resources:

Liquid Filters and Placeholders - Use the examples in this solution article and tailor them to your own use cases.


To view other posts in the series, search for #WorkflowoftheWeek


4 replies

Userlevel 2
Badge +1

Thanks @BrynCYDEF for the info.

In addition to this, I have couple of queries.

Sample case -

I have tickets description details like

User ID: 1234

User Name: Nick

Dept ID:9999

Contact: abc@gmail.com

I need to get the details of each field and then store this info somewhere like excel.

So using Substring function mentioned above I can get details against - User ID: ie.”1234” but do we need to give get data till end of string or start of next field. Then how to get the info of User Name: and then Dept ID likewise.

Do we need to write separate expression box for each field? can this be done in one go? 

any pointer/info will be helpful, Thank you in advance.

Userlevel 6
Badge +11

Hi @Tristan Tripp not sure if you got the answer already but here’s how I did it with Expressions inside of a workflow that triggers when FS receives the canned email screenshot below.

substring('{{ticket.subject}}',indexOf('{{ticket.subject}}','For Group', 0)+10,length('{{ticket.subject}}'))

Just count up the number of characters in your static code words e.g. For Group = 10 (8 letters and 2 spaces including the one at the end of the word “group” that way there won’t be a leading space on your info) and replace the +10 above with your character count.

You could rewrite the code above to pull info out of {{ticket.description}} if that’s where “Pharmacy State” is found.

My output from the code above on the screenshot above = group name

Then in the Action node of the workflow add an action after the Expression node (or many Expression nodes) to set any field as the result from the Expression as appropriate.

I do believe you can do this with Liquid Filters as well.

HTH - better late than never lol

Bryn

Userlevel 7
Badge +16

I absolutely love these threads!!! This is a great way to help isolate tickets as workflows become more and more complicated.

Is it possible to pull information after a certain string of text in description?

For example, If I’m receiving a ticket that always has the words:

Pharmacy State: ‘x’, where ‘x’ is a value that changes- can I use liquid filters to scan the description text to search for “Pharmacy State: “ and pull the text after it?

Reply