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 / Formatting The Text In...
Power Apps
Answered

Formatting The Text Input within a Form in order to add a comma for end users.

(0) ShareShare
ReportReport
Posted on by 97

Hello, 

 

I'm having an issue with formatting numbers within a text input field where I'm wanting to add a comma (i.e. 300000 = 300,000)

 

I currently have a solution in place but the value I enter in seems to change all of the other forms with the same number.  How can I get my code to only update the following form instead all the other forms with the same number. 

 

Data source: Excel 

 

On Change Property of Text Input:  Set(FormattedNum,Text(Value(DataCardValue19.Text),"[$-en-US] #,###"))

 
Default Property of Text Input: FormattedNum
 
The Field in Question is "Policy Maximum" "30,000".
Cwilliams12_3-1709061405680.pngCwilliams12_4-1709061431070.pngCwilliams12_5-1709061505978.pngCwilliams12_6-1709061520080.png

 

 

 


 

  • Cwilliams12 Profile Picture
    97 on at
  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    Those are different records, but its only one form. If you change the onChange property of the field it will affect all the entries in that field in all the records. There is no way to get it to apply to the control for only one record in the form. So I'm not sure what the problem is? Do you want some of the entries to not have a comma?

  • Cwilliams12 Profile Picture
    97 on at

    Yes, I'd like the comma to be added to all records. The problem is that each record number changes to the previous submitted record. For example, I submit a form with the "policy maximum" being 300,000. Once submitted, every records policy maximum changes to 300,000. I'm needing the submitted record to go through without changing my other records policy number. @Pstork1  

  • Verified answer
    vaubeee Profile Picture
    533 on at

    Hi @Cwilliams12 !

    If you are using FormattedNum on multiple forms, it will update to that specific format and value on every form once it is set, because you're hardcoding DataCardValue19.Text into it.

     

    Try this instead: 

    Set(FormattedNum;Text(Value(Self.Text);"[$-en-US] #,####"))

     

    If that doesn't work, you'll have to define separate variables for each field/form. Let’s call this one Formatted_PolicyMax_Form2 . Make sure to use this variable only in the specific field and that specific form.

     

    Hope this works for you!

     

    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question / helped to solve your problem, please accept as solution and give me a Thumbs up. Thanks! - Remember: you can accept more than one post as a solution.

  • Cwilliams12 Profile Picture
    97 on at

    @VauBee Can you show me how to define separate variables or at lease show me for example for the policy maximum field? The last bit of code didn't work and I'm trying to define separate variables for each field/form. Can you walk me through how to do that? I understand how to "set" a new variable, but I don't know how to for the form. The policy number still updates all other records. 

  • Verified answer
    lcdelgado Profile Picture
    379 on at
  • Verified answer
    vaubeee Profile Picture
    533 on at

    Hi @Cwilliams12 

    The formula should work and is definetly preferrable. I accidentially used a semicolon instead of a comma. Try to change the semicolon to a comma.

    However there is an alternative. Feel free to try this directly in the DEFAULT property of the field.  

    Text(Value(Parent.Default),"#,###.00","en-US")

     

    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question / helped to solve your problem, please accept as solution and give me a Thumbs up. Thanks! - Remember: you can accept more than one post as a solution.

  • Verified answer
    Cwilliams12 Profile Picture
    97 on at

    Thanks @lcdelgado for those links you provided. Very helpful! @VauBee The code you provided did the trick. Just wanted to mention for the On change property, is there a way for the values to update before submitting the form? The values update after submitting the form but wondering if any additional code in the On change property will update the value before submitting the form.

     

  • lcdelgado Profile Picture
    379 on at

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 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard