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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Keeping Leading Zeros ...
Power Automate
Answered

Keeping Leading Zeros from Forms

(0) ShareShare
ReportReport
Posted on by 83

I have a form that asks for an ID number that should contain two leading zeros. How do I ensure that the leading zeros remain when building my flow? I would like to verify that the user submitted exactly a nine-digit number and that they keep the leading zeros if they input them that way. I do not wish to exclude numbers that don't have leading zeros. 

Categories:
I have the same question (0)
  • Ellis Karim Profile Picture
    11,691 Super User 2025 Season 2 on at

    Hi @dedgerton1 

     

    One option could be to treat the ID as a string.

     

    You could then check if the ID starts with '00', that the length of the ID is 9 and that it is an integer using expressions and the Condition action:

     

    isInt('001234567')

    length('001234567')
    startsWith('001234567', '00')
     

    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.
  • dedgerton1 Profile Picture
    83 on at

    Would it be 3 separate "equals" rows under one condition? And do I replace your instance of 001234567 with Compose Output? These IDs could also start with "900," so how do I ensure that I'm not excluding those?

  • Verified answer
    Ellis Karim Profile Picture
    11,691 Super User 2025 Season 2 on at

    The following example should help:

     

    ekarim2020_0-1670601218853.png

     

    Your condition would be similar to the following:

    Snag_e8636cb.png

     

    I'm using the string function for 00 and 900 so that flow doesn't flag error that I'm trying to compare a string to an integer value.

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard