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 / Text input formatted a...
Power Apps
Unanswered

Text input formatted as number strips leading zero on submit

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm saving a phone number as text to SharePoint list (no reason to save as number as I'm not calculating anything off it).

 

To avoid the user putting actual text instead of numbers, I've formatted the input field as TextFormat.Number.

The SharePoint field type is text.

 

The problem is, the update back to SharePoint is stripping any leading 0's....

I've tried changing the Update field of the card to Text(inputfield.text) but it still does it.


Any ideas?

 

Kind regards,

 

R

Categories:
I have the same question (0)
  • JRaasumaa Profile Picture
    1,325 on at

    @Anonymous wrote:

    I'm saving a phone number as text to SharePoint list (no reason to save as number as I'm not calculating anything off it).

     

    To avoid the user putting actual text instead of numbers, I've formatted the input field as TextFormat.Number.

    The SharePoint field type is text.

     

    The problem is, the update back to SharePoint is stripping any leading 0's....

    I've tried changing the Update field of the card to Text(inputfield.text) but it still does it.


    Any ideas?

     

    Kind regards,

     

    R


    Can you force the patched format to include the leading 0 using the text format command?

     

    For example you can force a leading 0 onto a number value field being patched by using:

    Text(Value(TextInput1.Text),"0000")

    So if my input field is:  234

    My text input will become: 0234

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It seems it's being stripped by the TextFormat.Number type, so I'm trying to add zeroes where none exist.

     

    [edit-correction]

    sorry, forgot to pad it more - busy testing

     

    [edit]

    Nope, still strips the leading zero. Bizarre

     

  • JRaasumaa Profile Picture
    1,325 on at

    @Anonymous wrote:

    It seems it's being stripped by the TextFormat.Number type, so I'm trying to add zeroes where none exist.

     

    [edit-correction]

    sorry, forgot to pad it more - busy testing

     

    [edit]

    Nope, still strips the leading zero. Bizarre

     


    Can you provide an example of your input field and patch command? I've done a few tests and patching using: 

    Text(Value(TextInput1.Text),"0000")

     works to produce a leading 0

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi JRaasumaa,

     

    Sorry, it's part of a form and I'm using Submit, so if patch works then it might be Submit that's causing it - and I really don't want to patch 30-odd fields, or even submit and then repatch 1...messy.

     

    Current workaround is to revert to standard TextFormat.Text and include a regex pattern match to warn the user about text in a number field - but I'd really like to understand where and how the stripping is happening.


    Thanks

     

    R

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Anonymous

     

    I tried to do the same just having an simple SharePoint List with text. Adding and Edit Form, unlocking the text field and changing Format to TextFormat.Number

     

    I try to enter 001234 and click submit (which has function SubmitForm(Form1)) in the SharePoint list all the 00 are there and it is displayed as 001234 not 1234.

     

    It might be some other setting that is affecting the outcome.

  • JRaasumaa Profile Picture
    1,325 on at

    @Anonymous wrote:

    Hi @Anonymous

     

    I tried to do the same just having an simple SharePoint List with text. Adding and Edit Form, unlocking the text field and changing Format to TextFormat.Number

     

    I try to enter 001234 and click submit (which has function SubmitForm(Form1)) in the SharePoint list all the 00 are there and it is displayed as 001234 not 1234.

     

    It might be some other setting that is affecting the outcome.


     

    Is it possible Sharepoint isn't really storing it as text in his list?

     

    @Anonymous can you test the same thing on a new Sharepoint column to see if it still happens? It sounds like @Anonymous tested it better than I did and my guess is something wrong with the list.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard