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.


Best Regards

1 Like



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

Hope this may help you


1 Like

Hi @HeartCatcher

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.


Please see the below example:

1 Like


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

stroutput = strinput.ToString.PadLeft(8,CChar(“0”))

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

stroutput = strinput.ToString.PadLeft(11,CChar(“0”))

Hope this would help you resolve this

Cheers @HeartCatcher

1 Like

Hi @HeartCatcher

kindly find the below code

Sequence.xaml (10.1 KB)

Hope this helps

1 Like

Thanks all for your reply

If you have no more doubts

Kindly close the topic @HeartCatcher

Happy automation

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.