web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to Click a Hidden ...
Power Apps
Answered

How to Click a Hidden Button to Clear a Text Field (Without Automate)

(1) ShareShare
ReportReport
Posted on by 106
Hi all. 

I have a form with two data cards. One data card contains a Dropdown and the other contains an Text Input Field.
If the value selected in the Dropdown equals a Key Term, then the data card containing the Text Input Field is visible
so the user can input info. Otherwise, the data card with the Text Input Field is not visible. The code for this is below
and works great. Everything appears and disappears as it should.

Data Card for Text Input Field : Visible Property 
If(
    Or(
        Dropdown.Selected.Value = "Key Term 1",
        Dropdown.Selected.Value = "Key Term 2",
        Dropdown.Selected.Value = "Key Term 3"
    ),
    true,
    false
)
The issue is this: any info the user types into the Text Input Field remains inside it when the user changes their mind,
chooses a non Key Term in the Dropdown and the data card disappears. When the user submits the form, the
unneeded info submits with the form. I want to clear the Text Input Field when the data card itself is not visible. 

I tried doing this using buttons. Button1 resets the Text Input Field. Button2 selects Button1 when the
data card containing the Text Input Field is not visible. The code is below and does not work. Neither button
when the data card disappears.
 
Button1 : OnSelect Property
Reset(TextInputFieldValue)
 
Button2 : OnSelect Property
If(DataCardForTextInput.Visible = false, Select(Button1))
How should this be coded so either:
 
1) A chain reaction occurs (when Text Input Data Card is not visible > Button2 clicks > Button 1 clicks) or 
2) A direct action occurs (when Text Input Data Card is not visible > Button 1 clicks)
 
Please do not answer with Power Automate solutions/flows. The Automate flows I'm already using for this app
takes up to much time to respond and I'd prefer the response time between these buttons to be very very short to
immediate. Any in app solution to clear the text input field when the data card disappears, with or without buttons
is appreciated. Thank you!
Categories:
I have the same question (0)
  • Suggested answer
    Nandit Profile Picture
    1,568 Moderator on at
     
    Love the name :D
     
    You can add the following code to the OnChange property of your Dropdown:
    If(
        Or(
            Self.Selected.Value = "Key Term 1",
            Self.Selected.Value = "Key Term 2",
            Self.Selected.Value = "Key Term 3"
        ),
        Set(
            showDataCard,
            true
        ),
        Set(
            showDataCard,
            false
        );
        Reset(TextInputField)
    )
    Here is the Visible property of your TextInputFieldDataCard:
    showDataCard
    Hope this helps. 
     
    Kind regards,
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,362 Super User 2025 Season 2 on at
    Hi,
     
    Do this
     
    In your Text Inputs Reset property put this
    _ResetText
     
    This is just a variable I am making up
    In the OnVisible Property of the Screen, where the Form is put
     
    Set(_ResetText, true);
    Set(_ResetText, false);
     
    Now in your OnChange of the ComboBox, put the exact same thing at the top.
    Set(_ResetText, true);
    Set(_ResetText, false);
     
    This will force the TextInput to reset immediately as they select something in the combo, whether its Visible or not.
    And now you wont have those unneeded details.
     
     
     
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard