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 / Hiding a text input in...
Power Apps
Unanswered

Hiding a text input in a gallery with a button

(0) ShareShare
ReportReport
Posted on by 138

Hello guys,

 

I have a galley that has textinput for a field named comments, I added a button in this gallery to show/hide the comments input box by selecting the button, however this input box is always displayed on the app start and I cannot seem to know how to keep it hidden at the app start, and just showing it when the button is clicked.

 

Another issue is that I wanted the button to display the input box for one row in the gallery and not for all rows which is also a issue.

 

the code I'm using for the button OnSelect is: 

UpdateContext({varCommentsBox:!varCommentsBox})

 

and for the input text visiblity: varCommentsBox

I guess beyond the code above, I do need your advanced tips guys 🙂

 

Thank you

Categories:
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Greg68 It would be better to put the Button outside the Gallery and in the OnVisible of the Screen to do this,

    UpdateContext({varCommentsBox:false})

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

  • Greg68 Profile Picture
    138 on at

    In fact, I wish I can have the button inside the gallery, please check the attached screen shots, once the button is clicked the comments box show up!

    So you think this can't be done with a button inside the gallery?


    Screenshot 2023-03-13 112737.jpg
    Screenshot 2023-03-13 112708.jpg
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Greg68 You had mentioned earlier that you want the button to show in only one row. For that it would be better to put it outside the Gallery. If you want to have it inside the Gallery, you can. But to hide it for all but one, you need to have some condition. I'm not sure based on what condition you want to display or not.

  • Greg68 Profile Picture
    138 on at

    Yes I understand, inside the gallery and hiding and showing it for all rows is fine, however when the app starts I want those input boxes to be hidden.


    Hope I made myself more clear now 🙂

    Thanks for you help

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Greg68

    To have the button show in just one row, put ThisItem.IsSelected as it's visible property. 

  • Greg68 Profile Picture
    138 on at

    Great, this works to show for one row, but how to hide it?

    and then keep it hidden on app start, until the show button is clicked?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Greg68 

    To not show the textinput box when the app starts set the Default property of the gallery to {}

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 225

#3
M Bilal Khan Profile Picture

M Bilal Khan 192

Last 30 days Overall leaderboard