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

Make a button enter a value in a text field.

Hi Power App Community,

 

I have a request that should have a simple solution but I cannot figure out how to do it. 

 

I created a button and want that button to enter a value of 27 in a text input field. The text input field is later used in a calculation and I got that portion of it working. The text input field already has a number in there (6) and I want to replace that number with 27 every time I press this button. How do I do it using OnSelect? Any help is appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

@BubbleGhost 

Put this code in the OnVisible property of the screen.

 

Set(myCustomValue, Blank())

 

Use this code in the Default property of the Text Input you want to change to 27.

 

myCustomValue

 

Finally, take this code and use it in the OnSelect property of the button

 

Set(myCustomValue, 27);
Reset(Text_Input_FieldName);

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

11 REPLIES 11
Highlighted
Super User III
Super User III

@BubbleGhost 

Put this code in the OnVisible property of the screen.

 

Set(myCustomValue, Blank())

 

Use this code in the Default property of the Text Input you want to change to 27.

 

myCustomValue

 

Finally, take this code and use it in the OnSelect property of the button

 

Set(myCustomValue, 27);
Reset(Text_Input_FieldName);

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Highlighted
Super User III
Super User III

Insert a button and put this variable:
Set(No27,"27")
Then in the Textboxi default property put this:
Reset(Textbox1);No27

Anytime you press the button, the figure will change to 27

Replace Textbox1 with the actual name of your input textbox where user will enter data.
Highlighted
Super User III
Super User III

@BubbleGhost 

Did either @eka24 or I solve your question.  If yes, please accept as solution.  You can accept more than one solution.

Highlighted

Neither one worked.

 

I'm trying different combinations right now to get it work and will select a solution when I'm done.

Highlighted

@mdevaney 

 

I followed your instructions but when I click run and then click the button, nothing happens. No errors either.

Highlighted

@mdevaney @eka24

 

I'm going to post some screenshots soon but nothing happens when I click the button after your suggestions.

Highlighted

@BubbleGhost 

 

 

From my tests the comma "," should be replaced with a semicolon ";"  using @mdevaney  approach.

After  chaning this the button works fine in my testapp.

 

kind regards,

David

Highlighted

@David_Handke 

The reason I used commas is because my PowerApps tenant locale is set to English.  Those with other languages must used semi-colons instead of commas.  So far I know this is the case for Dutch, Spanish and Portuguese.  Others definitely exist.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted

attachments

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,948)