BPM to Verify Against a Custom List

Hello,

I’ve been struggling with this particular one. My specific use case is a little confusing, so I’ll give an example to make it easy.

I would like a BPM to throw an exception if the user has entered a “State” in the Customer record, if that state does not match to a list of state codes. ie: “AZ” “CA” “WA” etc.

I can easily create a condition that looks for the State that was entered against a single constant. But, I would then have to create 49 more “or” conditions.

Can someone provide any insight as to how I can lookup the field as entered, against a list of acceptable constants? This doesn’t need to look at another table of contstants, I could in theory include them in the code.

Hope this makes sense, and hope someone has a trick!!

-Ben

Store the state values in a table, such as User Codes, and then you use the State entered in a where clause against the User Codes table to validate. If you go this far you could make State a Combo and populate using this data.

1 Like

string myStates = “~AK~AL~AR~AZ~CA~CO~CT~DE~FL~GA~HI~IA~ID~IL~IN~KS~KY~LA~MA~MD~ME~MI~MN~MO~MS~MT~NC~ND~NE~NH~NJ~NM~NV~NY~OH~OK~OR~PA~RI~SC~SD~TN~TX~UT~VA~VT~WA~WI~WV~WY~”;
bool stateOK = myStates.Contains("~" + formStateField.Text + “~”);

if !(stateOK)
{
error message;
}

or something like that :wink:

Nice Bernie

Thanks guys. I’ll get crackin’!