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 / How do I change the fo...
Power Apps
Unanswered

How do I change the format of a text field but preserve the parent.default property

(0) ShareShare
ReportReport
Posted on by 831 Moderator

I have a field where I set up the OnChange property to the following.

 

UpdateContext({varCurrency: Text(Value(TXT_Budget.Text), "[$-en-US]$#,##0.00")})

 

Then in the Default property I use varCurrency.

 

My problem is that when I click a copy button I can't populate the field with Parent.Default. At least I haven't figured out how. The easiest way is to ditch the code to 'paint' the value into a currency value but it nice to have.

Categories:
I have the same question (0)
  • kelseytran Profile Picture
    292 on at

    Hi @futr_vision ,

     

    You can use the 'If' function to determine whether to display the formatted currency value or the 'Parent.Default' value based on a condition.  For ex. on the 'OnSelect' property of the 'CopyButton':

    UpdateContext({varUseDefault: true});

    Then in the 'OnChange' property of the 'TXT_Budget' text field:

    UpdateContext({
     varCurrency: Text(Value(TXT_Budget.Text), "[$-en-US]$#,##0.00"),
     varUseDefault: false
    });

    And the 'default' property of that text field:

    If(
     varUseDefault,
     Parent.Default,
     varCurrency
    )

    ------------------------------------------------------------------------------------------------------------------------------
    If I answered your question, please accept my post as a solution and if you liked my response, please give it a thumbs up.

    Thanks!

  • futr_vision Profile Picture
    831 Moderator on at

    I'll need to try this but does this preserve the formatting for Parent.Default? 

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 474

#1
Valantis Profile Picture

Valantis 474

#3
WarrenBelz Profile Picture

WarrenBelz 375 Most Valuable Professional

Last 30 days Overall leaderboard