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 / Filter Gallery and Dro...
Power Apps
Answered

Filter Gallery and DropDown OnStart App

(0) ShareShare
ReportReport
Posted on by 353

Hi all,

 

I have a page called Maintenance Page. Inside this page, there is 2 dropdown, Dept and Unit.

I also have gallery to display Dept, Unit and other columns related. When user first land to this page, I want to set by default, the items that they will see is Dept = Admin, and Unit = 100.

 

Currently, I have done this:

App.Onstart = ClearCollect(ColCC,ShowColumns(Filter(database, dept = "Admin", Ynit = "100", "dept","unit","xxxx"));

gal.Items = ColCC

 

 

When I play in the app it works, but when I publish, the gallery showed all items instead of filtered ones. How do I fix this? Appreciate your help 🙂

Categories:
I have the same question (0)
  • Verified answer
    v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @_kikilalaaa ,

     

    I suggest you set the code on the On Visible property of screen to test.

     

    Best regards,

    Rimmon Li

  • _kikilalaaa Profile Picture
    353 on at

    To give you some context, I only have total 480 rows on this table in databse

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @_kikilalaaa ,

     

    How's it going? If my answer solves your problem, please accept it as a solution to help more people stuck on the same problem find it.

     

    Best regards,

    Rimmon Li

  • Verified answer
    _kikilalaaa Profile Picture
    353 on at

    Hi, here's an update! It did work but I tweak a bit!

     

    To give more context, actually I have 2 collection, colCC and colCCRecord.

     

    colCC is the items to be shown in gallery, meanwhile colccrecord is just a filter of database, i have many columns in the database and i use this collection to fetch desired columns only onapp start.

     

    At first I use ColCCRecord in ClearCollect filter. But I have changed it to database path instead, and it works (not sure why tho, it is basically the same thing).

     

    The problem now is with the dropdown.if i select something in this page, and go back to previous page, and come again to this page, the dropdown is showing the items that i selected previously, but the items gallery displayed the default items (in this case, Dept = Admin, and Unit = 100). How do I reset the dropdown selected to its default if i go to other screen?

     

    Kindly share your ideas! 

     

    Love,

    kiki

  • Verified answer
    _kikilalaaa Profile Picture
    353 on at

    Hi all. i have resolved this issue too.

     

    To reset the selection to default it is very easy. Basically, in your dropdown, there is properties called "reset". 

     

    What you can do is, in user "Cancel" or "Back" icon, you can Set OnSelect:

    Set(varResetInput, true)

     

    And then, in you dropdown "Reset" properties:

    varResetInput

     

    this will reset the dropdown to it default selection whenever you select Back or Cancel.

     

     

    Hope this helps!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard