Blue Prism For Good

last person joined: 10 hours ago 

This community covers the Blue Prism for Good program.

Expand all | Collapse all

I've a scenario where I want to generate a sequential number and facing a challenge as mentioned below.

  • 1.  I've a scenario where I want to generate a sequential number and facing a challenge as mentioned below.

    Posted 07-20-2021 14:17
    I have a scenario where I want to generate a sequential number and facing a challenge as mentioned below.

    I have a 10 digit number with preceding zeroes for e.g. 0000000001 and I want to increment it by 1 so my result should be 0000000002 and so and so on. It's quite simple to increment number with calc stage but with blue prism, it removes the leading zero by default when I increment. Since leading zero to number is useless when doing ToNumber and increment blue prism gives output as "2" but I want output as "0000000002".

    This is quite obvious behavior but how can I achieve this use case using blue prism?

    ------------------------------
    Thanks & Regards,
    Tejaskumar Darji
    Sr. RPA Consultant-Automation Developer
    ------------------------------


  • 2.  RE: I've a scenario where I want to generate a sequential number and facing a challenge as mentioned below.

    Posted 07-20-2021 17:26
    Hi TejasKumar,
    if you can accept the result as a text then use the below VB code

    Decimal add = input + 1;
    result = add.ToString("000000000");




    ------------------------------
    Jerin Jose
    RPA Product SME
    EY
    Asia/Kolkata
    *"If you find this post helpful mark it as best answer, .*
    ------------------------------



  • 3.  RE: I've a scenario where I want to generate a sequential number and facing a challenge as mentioned below.

    Posted 07-20-2021 18:05
    Thanks for the answer. But my string length would change if my input is 0000000009 and the next increment would make it 10 and then code adds leading 9 zeroes resulting string be 11 lengths instead of 10.

    ------------------------------
    Thanks & Regards,
    Tejaskumar Darji
    Sr. RPA Consultant-Automation Developer
    ------------------------------



  • 4.  RE: I've a scenario where I want to generate a sequential number and facing a challenge as mentioned below.

    Posted 07-20-2021 20:39
    Try using the PadLeft action in Utility - Strings. You can specify how long you want the string to be as well as the character you want to pad the string with.

    ------------------------------
    Patrick Aucoin
    Product Manager
    Blue Prism
    ------------------------------



Blue Prism For Good

The Blue Prism For Good initiative addresses four distinct areas: Charity & Fundraising, Inclusivity, Supporting not-for-profits, and Education. These are unified by our vision to unleash society’s full potential and inspire the future of work through automation. As a predominantly grassroots movement, all suggestions and ideas for volunteering are welcomed.

What is BPFG? BPFG in IndiaBPFG LinkedIn