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 Apps / Why won't my text box ...
Power Apps
Answered

Why won't my text box format the value as currency?

(0) ShareShare
ReportReport
Posted on by 831 Moderator

I'm a little baffled here. I have an edit form being populated by a gallery selection. On one of the text input field I am using this code in the OnChange property.

 

 

Text(
 Value(TXT_BudgetReview.Text),
 "[$-en-US]$#,##0.00"
);

 

In the preview it appears to understand what to do with the value populated in the text field but the text field just no formatting.

 

futr_vision_0-1707243308661.png

futr_vision_1-1707243446662.png

 

What's happening here?

Categories:
I have the same question (0)
  • futr_vision Profile Picture
    831 Moderator on at

    Thanks. I'll need to revisit this. It's ultimately a cosmetic issue. Thanks for the help.

  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @futr_vision,

    If you check our official doc about the Timer, you should have known that the Duration property of the Timer will trigger the Timer in a customized duration.

    And yes, in a customized duration, Timer will auto-start and generate this varaible.

  • futr_vision Profile Picture
    831 Moderator on at

    Thanks. The timer overrides the built in timer for the OnChange property? Just want to make sure before I apply this to every control.

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @futr_vision,

    That's the limit of the OnChange property, it is by design.

    You could consider using a Timer, set the following properties:

    vqiaqimsft_0-1707349573147.png

    Then set the OnTimeStart property as the Set() function, apply the If() function to the Default property of the TextInput.

     

    Remember to set the Timer Visible as false to make the UI friendly.

  • futr_vision Profile Picture
    831 Moderator on at

    Ok. I see. I need to drop that code on the OnSelect of the gallery item and change it the 'target' tp ThisItem.columnname . Then put varCurrency as the default for the text input. Here is my problem. When I update the record and submit that text input continues to show varCurrency until I reset varCurrency with the same gallery selection. 

     

    This seems to work. I set Default of the text input to the expression below. There is a slight delay in the refresh that makes it seems wonky. Is there a better way?

    If(Not(IsBlank(varCurrency)), Parent.Default, varCurrency)

     

  • TheRobRush Profile Picture
    11,128 Moderator on at

    when you select a gallery item just apply the same logic Qi gave for manual input to the OnSelect of the gallery item so that varCurrency is generated

  • futr_vision Profile Picture
    831 Moderator on at

    I implemented this solution but now have this issue:

     

    When I select a gallery item the field is now blank instead of being populated by the gallery record. I suspect this is because I replaced Parent.Default with varCurrency.

     

    It does format the text correctly when I enter a new value however. That is working. I just need it to format the text being pulled in from the gallery selection and format and text entered.

  • futr_vision Profile Picture
    831 Moderator on at

    It's a Text Input so no Text property

  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @futr_vision,

    Your format formula is correct, however, OnChange property expects a behaviour formula, Text() is not a behaviour formula.

     

    And, only when the input from the TextInput of the Budget data card changes, the OnChange property will be fired.

    Set the OnChange property as:

    Set(varCurrency,Text(
     Value(TXT_BudgetReview.Text),
     "[$-en-US]$#,##0.00"
    )
    )

    Set the Default property of the TextInput control corresponding to Budget data card as:

    varCurrency

     

  • TheRobRush Profile Picture
    11,128 Moderator on at

    what code do you have in the Text property.

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 Apps

#1
Kalathiya Profile Picture

Kalathiya 401

#2
WarrenBelz Profile Picture

WarrenBelz 334 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 325 Super User 2025 Season 2

Last 30 days Overall leaderboard