You are viewing limited content. For full access, please sign in.

Question

Question

Removing Values From A Field

asked on September 23, 2015

I want to run a workflow that will examine an ID field and remove bad data.  Examples of data that could be in this field are

2490 (good data)

2490_invoice (bad data)

+@clientname (bad data)

 

Is there a way in workflow that I can create a token that would find the underscores in the ID and remove the underscore and anything after it?  As you can tell from the example, I also need to find ID's that start with a plus and completely remove those as well.  

My thought, but I was hoping someone could confirm this for me is I could use "Remove At" and if I have one Remove At set to remove at index underscore that would remove all underscores and anything after it.  I also thought I could use another Remove at set to remove at index plus sign and that would remove anything that starts with a plus sign.

 

0 0

Answer

APPROVED ANSWER SELECTED ANSWER
replied on September 23, 2015

The token function "Remove At" only removes indexes at multi value tokens. For instance, if you had the token 5;6;7 and Removed at Index '2', that would result in 5;7.

However, you can do this pretty easily with Regular Expressions. If you only want to grab starting numbers, you can use an expression ' [0-9]* ' to match your field in the Pattern Matching activity. This would return a token which in both of your examples would equal 2490.

You can also use a conditional sequence with a regular expression condition to see if the field has a + in it using the expression '\+' and then if it does, assign a new value.

2 0

Replies

replied on October 7, 2015

This has answered my question!  Thanks!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.