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 Apps / Remove Leading Zeros (...
Power Apps
Answered

Remove Leading Zeros (from a scanned Barcode) in Power Apps Text Input

(0) ShareShare
ReportReport
Posted on by 393

Dear Experts,

 

How can I formulate the text input to remove leading zeros (not trailing zeros)?

 

JAWL_1-1639619310334.png

JAWL_0-1639619267147.png

JAWL_2-1639619349437.png

 

 

Categories:
  • rsaikrishna Profile Picture
    3,703 on at

    @JAWL 

     

    You can place label below the TextBox1 control and set its Text property with following formula:

     

    Value(TextBox1.Text)

     

    You can place same formula in the Textbox also.

     

    I hope this will help you.

     

    Regards

    Krishna Rachakonda

    If this reply helped you to solve the issue, please mark the post as Accepted Solution. Marking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.
  • JAWL Profile Picture
    393 on at

    @rsaikrishna 

    My Default formula for the DataCardValue is Value(varScanTO):

    JAWL_2-1639638831754.png

     

     

    No issue if I use the Barcode Scanner button in Power Apps:

    JAWL_0-1639638703453.png

     

    But it still shows leading zeros if I use the external scanner:

    JAWL_1-1639638715071.png

     

    I have also tried below formula but nothing works:

    JAWL_0-1639640904112.png

     

     

  • rsaikrishna Profile Picture
    3,703 on at

    @JAWL 

     

    Please try below workaround:

     

    Place another textbox or label "TextBox2" on the screen along with your existing Textbox.

    TextBox2.Text = Value(TextBox1.Text)

     

    Please check if you are getting appropriate number with external scanner. If you do, then hide the first textbox control. 

     

    Please give a try and let me know if that works or not.

     

    Regards

    Krishna Rachakonda

    If this reply helped you to solve the issue, please mark the post as Accepted Solution. Marking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.
  • JAWL Profile Picture
    393 on at

    @rsaikrishna I guess it should work but when I click Submit Form button, it will take DataCardValue instead of the text input right? Or I should use patch function to submit the textbox input instead?

     

    Why can't I just modify formula in the DataCardValue directly?

    JAWL_0-1639703047990.png

     

    Must create additional Text Input/Label to remove leading zeros?

     

  • Verified answer
    rsaikrishna Profile Picture
    3,703 on at

    @JAWL 

     

    In the data card's Update property, mention Label1.Text value.

     

    When you submit the form, it will submit the value from the Label1.Text.

     

    Regards

    Krishna Rachakonda

     

  • JAWL Profile Picture
    393 on at

    @rsaikrishna 

    There is an error:

    JAWL_0-1639713407862.png

     

  • Verified answer
    JAWL Profile Picture
    393 on at

    Hi @rsaikrishna thanks for your meeting invite to resolve this error! Big thanks!

     

    So the solution that you have showed me is to use the formula for DataCard Update property as per below. Default property can maintain as ThisItem.Title.

    JAWL_0-1639718083105.png

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard