Collect string up to pipe |

Share your macros, knowledge, solutions, services, ...
Post Reply
Posts: 6
Joined: Tue Apr 11, 2017 3:49 pm

Collect string up to pipe |

Post by jfusco » Tue Apr 11, 2017 4:06 pm

Using PK 7.6.7 because that's what the company had a license for.

I have a macro that captures a line of text to grab a case title for an email subject. Our title format is currently "Warranty/System/Issue" and it comes through just fine. Starting soon, our title format will switch to "Issue and System|additional info"

Using the new format it pops up a box asking what I want the value to be, Issue and System or additional info. No matter what I select, it does not generate an email when it calls the vbscript.

Here's what happens in regards to the email subject:
1. Open the case summary window and copy everything from it
2. Grab the line that includes the case number then grab the second word
3. Grab the line that includes the case title (it's on a line by itself)
4. Build the subject line: "Case #" caseNum " - " caseTitle
5. Call appropriate VBSript file to create empty email or email from template with the created subject line

What I currently end up with for a subject line is "Case # 123456 - Warranty/System/Issue"

How can I go about building the second half of my subject line with everything prior to the pipe | character? I've tried grabbing each word from the line and stopping when it hits the | character but that doesn't work. It ignores the | and asks me which half of the string I want to use. I've looked for a special character reference, such as _vQuoteChar but there isn't one for the | in the help file. I even tried using _vPipe but it didn't work.


Post Reply