Strind Extracting in Transform

Hi all,

I want extract the string from a field as follow :

i am saving key,value in SSO database and having a scripting functoid to read it from there.

I want to check that if the value retrieve from the SSO table (CatchValue) is true then SSN4 number needs to mask as follows :

SSN4 -> check if SSN4 is not null (it will be always 123-12-1234 format)

I want to extract the last four digit and mask first 5 digit with zero as - 000001234.

How to do this usign biztalk func

August 19th, 2015 1:45pm

Hi Nitin,

Here you go..

After getting the value from SSO call this function using scirpting functoidI want to check that if the value retrieve from the SSO table (CatchValue) is true then SSN4 number needs to mask as follows : You can use logical eq functoid to check against true and if it true then call the below function

 public string PadLeftwithZeros(string ssn)
        {
            try
            {
                if (!string.IsNullOrEmpty(ssn))
                {
                    string s1 = ssn.Replace("-", "");
                    ssn =  s1.Substring(s1.Length - 4).PadLeft(9,'0');

                }
                return ssn;
            }
            catch
            {
                return ssn;
            }
        }

Cheers

Free Windows Admin Tool Kit Click here and download it now
August 19th, 2015 7:10pm

Hi Nitin,

Another way also, place this in scripting functoid, pass catchValue, SSN4 parameters and connect to destination field.

public string ExtractSSN(bool catchValue,string SSN4)
        {
            try
            {
                if (catchValue=true && !string.IsNullOrEmpty(SSN4))
                {
                    return SSN4.Substring(SSN4.LastIndexOf('-') + 1).PadLeft(9, '0');
                }
                return "";
            }
            catch (Exception)
            {
                return "";
            }
        }

Thanks, SMSVikasK

August 20th, 2015 4:27am

Hi Nitin,

Another way also, place this in scripting functoid, pass catchValue, SSN4 parameters and connect to destination field.

public string ExtractSSN(bool catchValue,string SSN4)
        {
            try
            {
                if (catchValue=true && !string.IsNullOrEmpty(SSN4))
                {
                    return SSN4.Substring(SSN4.LastIndexOf('-') + 1).PadLeft(9, '0');
                }
                return "";
            }
            catch (Exception)
            {
                return "";
            }
        }

Thanks, SMSVikasK

Free Windows Admin Tool Kit Click here and download it now
August 20th, 2015 8:23am

Hi Nitin,

Another way also, place this in scripting functoid, pass catchValue, SSN4 parameters and connect to destination field.

public string ExtractSSN(bool catchValue,string SSN4)
        {
            try
            {
                if (catchValue=true && !string.IsNullOrEmpty(SSN4))
                {
                    return SSN4.Substring(SSN4.LastIndexOf('-') + 1).PadLeft(9, '0');
                }
                return "";
            }
            catch (Exception)
            {
                return "";
            }
        }

Thanks, SMSVikasK

August 20th, 2015 8:23am

Hi Nitin,

Another way also, place this in scripting functoid, pass catchValue, SSN4 parameters and connect to destination field.

public string ExtractSSN(bool catchValue,string SSN4)
        {
            try
            {
                if (catchValue=true && !string.IsNullOrEmpty(SSN4))
                {
                    return SSN4.Substring(SSN4.LastIndexOf('-') + 1).PadLeft(9, '0');
                }
                return "";
            }
            catch (Exception)
            {
                return "";
            }
        }

Thanks, SMSVikasK

Free Windows Admin Tool Kit Click here and download it now
August 20th, 2015 8:23am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics