Workflow Soluiton

 View Only
  • 1.  Extracting first part of a variable?

    Posted Sep 17, 2018 08:02 AM

    Hi,

    I must be having a blonde moment as this seems so simple on paper.  I've created a Workflow which collects emails and then looks for patterns in the body and this is working well.

    In the subject heading is a 4 digit reference which starts (Letter)(number)(number)(number)

    I want to extact this to a variable but can't seem to do it.  I was looking at the Find Common Pattern but this only has pre-defined Regular Expresions?

    How do I easily just grab the first for characters from the email subject?

     

    Thanks in advance!

    Al



  • 2.  RE: Extracting first part of a variable?
    Best Answer

    Posted Sep 18, 2018 02:43 AM

    Workflow has a Component for this.

    Extract Text From Text
    https://www.symantec.com/connect/articles/extract-text-text

    Input Variable: [Your Subject]

    Begin Location: 0

    Untick "Get All Text After Begin"

    Length: 4

    ---

    I wrote an article a while ago about using the 'Extract Text By Pattern' component

    https://www.symantec.com/connect/articles/workflow-tag-finder

    Extract Text By Pattern
    https://www.symantec.com/connect/articles/extract-text-pattern

    ---

    Another option is to use REGEX in a scripting component.

    You can test it first using an online tool like RegExr https://regexr.com/

    Using Code Script Component with regex pattern (Workflow) by ' Stefan S.'
    https://www.symantec.com/connect/downloads/using-code-script-component-regex-pattern-workflow



  • 3.  RE: Extracting first part of a variable?

    Posted Nov 20, 2018 08:37 AM

    Did you solve this?



  • 4.  RE: Extracting first part of a variable?

    Posted Nov 20, 2018 08:47 AM

    Hi,

    Sorry I thought I had replied to this as well at the time when you replied previously.

    Yes, I used the extract from text to get it working the I wrote a script to get all variables into an array when there was more than one on an email

    Working well too and I've since been able to create a new email template for the system so I could easily lay out the template in the format I wanted to make the Workflow easier to process :)

    Sorry for not replying at the time, I thought I had :(

    Really apprecated your help then as I did today!



  • 5.  RE: Extracting first part of a variable?

    Posted Nov 20, 2018 09:06 AM

    Happy to help and glad you got it working, great to hear you can use new templates too!