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

Question

Question

What is the best way in Quick Fields to convert a full state name to the abbreviated form?

asked on November 7, 2013

I have a Quick Fields Session and the metadata field for a state needs to be the two letter abbreviation of the state name. I am getting a token from a zone OCR that sometimes will have the abbreviation and sometimes will not.

 

I was thinking of ideas, but formatting the token doesnt work for a state name. Substitutions get messy and no real good way to do it without adding a whole lot of processing to each document class in the session.

 

Does anyone have any ideas on how best to handle this?

 

1 0

Answer

SELECTED ANSWER
replied on November 8, 2013

Lookup process or field lookup would be grreat. Unfortunately that means the session relies on an external location and that is no good for a list of 50 states. I ended up using 5 conditionals that related to the lettering for the state name.

 

1. Caught all states that have two words to them

2. caught all states that abbreviates to the first 2 letters

3. caught all states that abbreviated to the 1st and 3rd letters of the name

4. caught all states that abbreviated to the 1st and 4th letters of the name

5. caught all states that abbreviated to the 1st and 5th letters of the name

 

Obviously there was a bit of conditional statement work there to make it all work together but using those conditional sequences and assign token values activities inside them each, I was able to modify the name of the state with a regular expression. 

 

I have yet to test performance but the conditionals all rely on the previous ones returning false otherwise they will fail to validate and thus only 1 should be run, but all will be evaluated

0 0

Replies

replied on November 8, 2013

Lookup could use a text/Excel file on the machine. I'd have expected that, setup-wise, dumping the state full name and abbreviation into a list is faster and less painful than setting up conditions. Depending on the machine specs, it might be faster to get the values through lookup. (I wasn't even aware that there were rules to the state abbreviations.) But glad to see you got it working.

1 0
replied on November 8, 2013

My demo machine where I was testing this all out and building the session actually has trouble since it also has workflow designer in 64-bit and the 32-bit drivers for ODBC are not fully installed because the 64-bit version are installed and in use. If I cannot connect to it then I cannot build something.

0 0
replied on November 7, 2013

Use the lookup process or field lookup.

0 0
SELECTED ANSWER
replied on November 8, 2013

Lookup process or field lookup would be grreat. Unfortunately that means the session relies on an external location and that is no good for a list of 50 states. I ended up using 5 conditionals that related to the lettering for the state name.

 

1. Caught all states that have two words to them

2. caught all states that abbreviates to the first 2 letters

3. caught all states that abbreviated to the 1st and 3rd letters of the name

4. caught all states that abbreviated to the 1st and 4th letters of the name

5. caught all states that abbreviated to the 1st and 5th letters of the name

 

Obviously there was a bit of conditional statement work there to make it all work together but using those conditional sequences and assign token values activities inside them each, I was able to modify the name of the state with a regular expression. 

 

I have yet to test performance but the conditionals all rely on the previous ones returning false otherwise they will fail to validate and thus only 1 should be run, but all will be evaluated

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

Sign in to reply to this post.