cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
joybaylon_
Frequent Visitor

Input Text Field: When user input numbers it automatically convert to dollar format. And clear that text field when clicking a button.

joybaylon__0-1631607727955.png

I have this code in default:


If(
varFormat4>0,
Text(
varFormat4,
"#,###"
)
)

 

And in on change:

With(
{
wFormat4:

Value(Self.Text)

},
UpdateContext(
{
varFormat4:
Round(
wFormat4,
2
)
}
)
);
Reset(Self)

 

but I was unable to clear the text field using reset(textfield);

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @joybaylon_,

Have you solved your problem?

Do you want to clear the TextInput content clicking a button?

I want to explain to you that the Reset() function restore the control to a default status which depends on how you set the Default of the control. And you set the Default property of the Text input with a variable, that's why you could not reset it.

If you want to reset this, I recommend the following solution for you.

1). Modify your formula set for the OnChange as below:

With(
    {wFormat4: Value(Self.Text)},
    Set(
        varFormat4,
        Round(
            wFormat4,
            2
        )
    )
);
Reset(Self)

2). Please set the OnSelect property of the button as below:

Set(varFormat4,0)
Best Regards,
Qi

View solution in original post

2 REPLIES 2
v-qiaqi-msft
Community Support
Community Support

Hi @joybaylon_,

Have you solved your problem?

Do you want to clear the TextInput content clicking a button?

I want to explain to you that the Reset() function restore the control to a default status which depends on how you set the Default of the control. And you set the Default property of the Text input with a variable, that's why you could not reset it.

If you want to reset this, I recommend the following solution for you.

1). Modify your formula set for the OnChange as below:

With(
    {wFormat4: Value(Self.Text)},
    Set(
        varFormat4,
        Round(
            wFormat4,
            2
        )
    )
);
Reset(Self)

2). Please set the OnSelect property of the button as below:

Set(varFormat4,0)
Best Regards,
Qi

View solution in original post

that worked! thank you!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,450)