# Entering the Policy number to a portal

Hi All,

I want to enter the policy number to a portal.
I have an excel with column “Policy number” First I need to find the length of the policy number if the policy number is <=8 I need to insert zero based on length of policy number for example if the policy number(PN) is 1234567(7 digits) ,I need to add two zeros before the digits like 001234567, if PN is 12345678(8digits) then the output after adding zero should be 012345678(which is 9 digits) then I need to pass the 9 digits policy number to the portal for the further process.
In same way if the policy number contains >8 and <=10 digits policy number then i need convert into 11 digits number by padding or adding zero before the digits
for example if the policy number is 123456789(9digits) then output should be(00123456789) after adding zeros which will become 11digits,
if the policy number is 1234567890(10 digits) then output policy number should be 01234567890(11 digits) after converting the digits less than 9 to 9 digits and greater than 8 digits and less than 11 digits to 11 digits I need to pass the Policy number in to a portal further process.

Anyone please guide me how to do this.
@nikhil.girish
@lakshman
@Yoichi
@ashwin.ashok
@Palaniyappan
@Nithinkrishna

Blockquote

Best Regards

1 Like

PolicyNumber
39263737
84644205
249386646
1079291133
220110300
430680700
97384700
1058664029
404358907
1126398120

@HeartCatcher

You can use If Condition and check for “1234567”.Length <= 8

Then → Place TypeInto and in that write as “1234567”.PadLeft(9,CChar(“0”))

Likewise you can define for the remaining conditions as well

Thanks

1 Like

Do it in below way.

Your 11 digits is fixed right? or whatever the number is. You can use below simple expression. I have used it for 11 digits you can use it for any number you want.

intVariable.ToString(“D11”)

Please see the below example:

1 Like

Hi

Hope the below steps wouldnhelp you resolve this

Use a if condition like this

Strinput.Length <= 8

If true it goes to THEN BLOCK WHERE USE A ASSIGN ACTIVITY like this

If the above condition doesn’t match it goes to ELSE block where use a another IF activity like this

Strinput.Length >= 8 AND Strinput.Length <= 11

If true it goes to its THEN block where use a assign activity like this

Hope this would help you resolve this

Cheers @HeartCatcher

1 Like

kindly find the below code

Sequence.xaml (10.1 KB)

Hope this helps
Thanks

1 Like