Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

Getting a Form Value Programmatically

Posted on by 4
How can I read the value of a text element on a Power Apps edit form programmatically?
 
E.g. I've put a button on the form and whenever I click the button I want to read the value of whatever the user typed into a text element.
 
And then maybe after reading it, I'll want to change it and write it back. Is that possible with Power Apps?
 
Thanks! 
Categories:
  • Suggested answer
    ronaldwalcott Profile Picture
    ronaldwalcott 903 on at
    Getting a Form Value Programmatically
    You could use something like 
    UpdateContext({varMessage: "Hello, World!"});
    UpdateContext({buttonPressed: true});

    in theOnSelect of a button and 

    If (
        buttonPressed,
        varMessage,
        Parent.Default
    )

    in the default of the datafield but do you want to be able write back the original value and overwrite more than once as the buttonPressed value still needs to be reset (probably on update or cancel). 

    You can read the value by using the text property of the control thus TextInput.Text

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,297

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,890

Leaderboard