Workflow Soluiton

 View Only

Names Containing Apostrophes And FindServiceDeskContact Component 

Jun 15, 2010 06:36 PM

I've had a couple Workflow developers contact me asking about a solution for finding contacts containing apostrophes using the Find Service Desk Contact component in Workflow Solution. The following will display a common error and a very easy way to solve it.

SAMPLE CASE:

Part of your Workflow project searches for a Service Desk Contact. Your current configuration works really well, however, it errors when searching for John O'Connor or Jane O'Neill or any other name that contains an apostrophe. The following error was generated when searching for the name O'Neill, Jane. If you receive the following error, read on, there is a very easy solution:

The above error is caused by the apostrophe on the contact's name. As you can see, the "O" from O'Neill was left out from the error message. On many Workflow components, quotation marks are a given (so you don't have to type them) when entering variables.

The apostrophe on the contact's name breaks the component as it thinks you entered an additional variable making the string look something like this: 'O'Neill'

The 'O' was processed, however, the Neill' was not as it's missing a quotation mark right before the N.

SOLUTION:

By using the Replace String In Text component, you will accomplish two tasks:

  1. Identify names with apostrophes
  2. Replace one apostrophe with two apostrophes

This procedure will change your variable only it it finds a name with an apostrophe, closing the name string and making it look something like this: 'O''Neill'. (Please note the double apostrophes between the O and the N, not to be confused with a quotation mark)

The following displays an example for configuring the Replace String In Text component for correcting the above:

Input Variable Name: This would be the contact's name (O'Neill, Jane)

Replace Text: This would be the single apostrophe

Replace With: This would be two apostrophes (no spaces)

Output Variable Name: You can use the same input variable name (if you choose to). Just ensure this is also the input variable you use on the Find Service Desk Contact component.

VERY IMPORTANT: Make sure you place the Replace String In Text component before the Find Service Desk Contact component. It should look like this:

Hope this helps out in any way...

Cheers!

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Jun 15, 2010 05:52 PM


Great write-up Andy, keep them coming!

Related Entries and Links

No Related Resource entered.