web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Generate a unique numb...
Power Automate
Unanswered

Generate a unique number for document

(0) ShareShare
ReportReport
Posted on by 87

Hi!
I have a flow to generate a Word document and I want to generate a unique number to it. The number will be included in the title of the document and additionally write it in the "Unique number" column. The number must be 5 digits.
Screenshot_204.png
The file ID is not suitable in this case, because I want to be able to reset the unique number to 00000. Can you please tell me how to implement this approach?

Categories:
I have the same question (0)
  • MarvinBangert Profile Picture
    1,924 Most Valuable Professional on at

    Hi @Pavel48n0sh 

    you can the "rand()" expression:

     

    rand(0,99999)

     

    It returns a random integer from a specified range. Of course this could also return less than 5 digits, you can use the "formatNumber()" expression to fix this:

     

    formatNumber(rand(0,99999),'D5')

     

    "D" stands for digits, there are also some more like "C" for currency, "X" for hexadecimal etc. Another format would be using placeholders like:

     

    formatNumber(rand(0,99999),'00000')

     

     

    Does this help you? Otherwise please give me some more information.

    Best regards
    Marvin

    If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

    Blog: Cloudkumpel

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard