Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - General Discussion
Answered

How to generate auto increment reference number format BER/ANG/001/2023 in power Automate?

Like (0) ShareShare
ReportReport
Posted on 20 Dec 2023 12:42:19 by 13

When Item is created in share point list,I want to generate reference Number i.e  BER/ANG/001/2023. How to do that? the incremental Numbers will be 001,002,003... the others BER/ANG and Current year 2023 remains constant

  • Verified answer
    cmht Profile Picture
    82 on 20 Dec 2023 at 14:15:55
    Re: How to generate auto increment reference number format BER/ANG/001/2023 in power Automate?

    Hi @berihunaddis 

    Use a variable which you will increment.

    You can add additional SharePoint list which will store your number.

     

    For the year I would use Compose:

    utcNow('yyyy')

    so this will always give you the current year.

    cmht_1-1703080996639.png

     

    Auto increment value - initializing variable which will keep it:

    cmht_2-1703081046868.png

     

    Now we read the current value stored on a helper SharePoint list:

    cmht_3-1703081125741.png

    and we are setting varInc to the value we have on the SharePoint list.

     

    Now it would be ok to convert it to integer (to be able to increment it):

     
    int(variables('varInc'))

    cmht_7-1703081628679.png

     

    Now incrementing this value:

    add(outputs('Convert_varInc_to_integer'),1)

    cmht_4-1703081256271.png

     

    and save (update) on SharePoint, so next runs will read the current number and add +1 with the flow run:

    cmht_5-1703081379613.png

     

    so now you may configure your invoices numbering as:

    BER/ANG/outputs('Increment_varInc_value')/outputs('ComposeYear')

     

    This will give you number as 1, 2, 3 and not 001, 002, 003.

    Explanation and solution is here:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Add-leading-zeros-to-digits-using-Text/m-p/269603#M78771

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,731 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,075 Most Valuable Professional

Leaderboard
Loading started