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

Question

Question

Auto-Create Employee ID By Extracting Partial Alpha/Numeric Characters From Different Form Fields

asked on September 6, 2017

What would be the best approach (workflow, jscript, calculation, CSS, etc.) to extract the first three characters from the Last Name field, the first character from First Name field and the last 4 digits from the SSN field in forms and populate the result (in all caps) in the Employee ID field in SQL table?  Can you provide the details of the best method based on the following forms field data:

First Name:  John

Last Name:  Smith

Social Security Number:  XXX-XX-1234

Desired SQL Table Column Result for Employee ID:  SMIJ1234

0 0

Replies

replied on September 6, 2017 Show version history

Hi John,

I had a similar requirement and I used scripts on forms (for fields - convert to upper case) and workflow to get the pattern as required.

Use Retrieve Application form Variables in workflow to get first name, last name and SSN. Then use pattern matching to extract the required characters (for example,\D will return the 1st char of the token, ([-][0-9]{4}) will extract last 4 digits of the SSN with '-') and use the resulting patterns to populate value in insert data.

 

To conver to uppercase - found it from a previous post

Add the class "upperCase" to each field you want converted 

$(document).ready(function(){

  $('.upperCase input').focusout(function() {

    $( this ).val($( this ).val().toUpperCase());

  });

});

Hope this will get you started.

 

Thank you. 

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

Sign in to reply to this post.