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 / Reset Gallery and Text...
Power Apps
Answered

Reset Gallery and Textinput with only 1 button

(0) ShareShare
ReportReport
Posted on by 148

Can you help me with this:

A 'clear' button becomes vissible when entering text in a searchfield (Textinput). OnSelect of this button formula is: Reset(TbSearchInput). This works fine.

 

The searchresults are shown in a Gallery1. How do I adapt the formula in a way that OnSelct the searchfiels as wel as the Gallery will be Reset so that no previous results are shown.

 

I tried this 2 adaptations but both do not reset the Gallery1.

1. Reset(TbSearchInput);Reset(Gallery1)

2 Collect( [TbSearchInput, Gallery1], Reset )

Categories:
I have the same question (0)
  • developerAJ Profile Picture
    4,763 on at

    @FZ80 

     

    Please provide the items formula of gallery. if you are using textbox input as filter condition. Once you clear the Text input, gallery resets automatically.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • FZ80 Profile Picture
    148 on at

    Hi,

    This is the Fx I use:

    Items Fx: Distinct(Filter(TblSAK; StartsWith(Storing; searchQuery)); Storing)

  • Verified answer
    Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @FZ80 ,

     

    You can try the following:

    If(
     !IsBlank(searchField),
     Distinct(Filter(TblSAK; StartsWith(Storing; searchField)); Storing)
    )

    Hope this helps

  • FZ80 Profile Picture
    148 on at

    Hi Ethan,

    Sorry but I am realy new to Power Apps. Does your suggestion replace the Items Fx in the Gallery I gave you or is it for the button?

  • developerAJ Profile Picture
    4,763 on at

    Hi @FZ80 

    Use below formula for gallery
    Distinct(Filter(TblSAK; StartsWith(Storing; searchQuery)||Isblank( TbSearchInput.text));Storing)

    output : if TbSearchInput is empty all items will be displayed else it will filter based on Value in text box

    for button :reset(TbSearchInput)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

     

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    @FZ80 ,

     

    Its for gallery items,

    When you reset the Textbox then you won't see any records in Gallery.

    Else it will filter data based on textbox.

     

  • developerAJ Profile Picture
    4,763 on at

    @FZ80 

     

    you want output like this?

    When you reset the Textbox then you won't see any records in Gallery.

    Else it will filter data based on textbox.

  • FZ80 Profile Picture
    148 on at

    Thanks Ethan, your formula works fine. I see have to learn a lot 🙂

  • FZ80 Profile Picture
    148 on at

    Thanks for your help AJ. It works fine. Just before your formula I got a somewhat simular suggestion from Ethan that did the job also. So I think it is fair to accept that one as solution. Thanks again!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard