Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Have a Gallery Contain Data Before Applying Search.

(0) ShareShare
ReportReport
Posted on by

Good morning,
I have an app that uses a Gallery and when an item in the gallery is selected the form populates with the data.
The issue I am having is that I want the gallery to reset after the Save Edit button is pressed.

I press the "Edit Existing BCL Manager Incentive" button
Form One:

ChrisL58_2-1714575033563.png

Form 2:

I type the name in the search box, which then reveals the records.

ChrisL58_3-1714575356901.png

The code I used in the Gallery Items property is.

Filter('BLC Manager Incentive_List',StartsWith(Manager,TxtSearchBox_1.Text)||StartsWith(Colleague,TxtSearchBox_1.Text))

When I click the "Edit Record" button the Display Mode changes from View to Edit allowing me to change a record, which also reveals the "Save Edit" button.
When I click the "Save Edit" button my confirmation popup form displays where I can either choose to make the edit or cancel the edit. Below is what I am using in the OnSelect property for the "Yes" option to submit the edit.

SubmitForm('BLC Mgr Incentive Form_Edit_1');Set(varShowEdit,false);Reset(TxtSearchBox_1);Notify("New BLC Manager Incentive was modified successfully!",NotificationType.Success,5000);ResetForm('BLC Mgr Incentive Form_Edit_1');
What happens next is I see an empty gallery and an empty form.
Form three:
ChrisL58_4-1714577316199.png

But if I start adding characters in the search box it starts a search and then populates the form.
What I would like to do is refresh the form after the edit showing records to start a new search just as I showed in Form Two.

Categories:
  • ChrisL58 Profile Picture
    on at
    Re: Have a Gallery Contain Data Before Applying Search.

    Perfect!
    Thank you!

  • Verified answer
    RogierE Profile Picture
    862 Super User 2025 Season 1 on at
    Re: Have a Gallery Contain Data Before Applying Search.

    I guess you would want all records to be shown as long as there is no search text entered. You can do that by adding ||Isblank(TxtSearchBox_1.Text) to your filter like this

     

    Filter('BLC Manager Incentive_List',StartsWith(Manager,TxtSearchBox_1.Text)||StartsWith(Colleague,TxtSearchBox_1.Text)||Isblank(TxtSearchBox_1.Text))

     

    Please LIKE the reply and ACCEPT it as the solution if the answer is what you were looking for.
    (to help me grow in community rank and help others find the solution)

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,026 Most Valuable Professional

Leaderboard