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 / Set text field with a ...
Power Apps
Answered

Set text field with a value using a button (OnSelect)

(0) ShareShare
ReportReport
Posted on by 68

Hi All,

 

Happy 2020 !!

 

I have a very simple question here, I need to be able to click on a button that will set a "Single Line of Text" field with a value.

 

I am using currently a variable to update the text field but the problem when I open again the form the text field is blank since the variable value was reset, please find attached screenshot on how I am doing it.

 

My question: is there a way to set the text field with a value that will not change when I re-open the form?!

 

thank!

 

reg

Eyad 

2020-01-03_16-13-15.jpg
Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @EMohaisen 

    Assuming your form submitted successfully you should use code like this in the Default property.  Make sure 'Request Status' is changed to the field name matching your spreadsheet.

    ThisItem.'Request Status'

     

    ---
    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."

  • EdMoh Profile Picture
    68 on at

    Hi @mdevaney 

     

    Thanks for the reply.

     

    Sorry, I didn't get your solution here, I changed the default value as you mentioned, but what I should write now on the button's "OnSelect"? please find my new screenshot and also you may want to have a look at the original screenshot on this post.

     

    Thanks again for your help!

     

    reg

    Eyad

     

    2020-01-04_11-35-46.jpg
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @EMohaisen 

    Agreed, we will have to write some new code here but not for the OnSelect property.

     

    My suggestion is for the form to show the value from 'ThisItem.'(TEXT Temp) Request Status' until the user clicks the New Submit which changes it to "01-Sending".  To do this I would change the Default property to the following code:

     

    If(
     IsBlank(VarTempRequestStatus),
     ThisItem.'(TEXT Temp) Request Status',
     VarTempRequestStatus
    )

     

    Give this a try and come back to the forum with any questions.

     

    ---
    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."

  • EdMoh Profile Picture
    68 on at

    Thanks a lot @mdevaney  !

     

    This works and solved my problem, an excellent idea!

     

    reg

    Eyad

  • mdevaney Profile Picture
    29,991 Moderator on at

    @EMohaisen 

    You are most welcome.  Take care my friend.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard