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 / Display Default Value ...
Power Apps
Unanswered

Display Default Value of Gallery

(0) ShareShare
ReportReport
Posted on by 75

Hai, i have a question, im looking for this solution almost a week and cant find an answer for this. Please help me.

My gallery code:
Sort(
Filter(
ReportDetailsTable,
(StartsWith(StaffEmail, SearchInputBox.Text) ||
StartsWith(ID, SearchInputBox.Text)) &&
Status.Value = "Pending" &&
Category.Value = 'Dropdown category'.Selected.Value
),
Switch(
varSortColumn,
"SubmissionDate", 'Submission Date'
),
varSortDirection
)




my dropdown code:
Distinct(ReportDetailsTable,Category.Value)


The problem: I cant add "ALL" Value in the dropdown list, which will show all items = pending status only, in the gallery. Please help..

Categories:
  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    Hi @nayem ,

    In the Items of your drop-down

    Ungroup(
     Table(
     {Data: Table({Value: "All"})},
     {
     Data: 
     Distinct(
     ReportDetailsTable,
     Category.Value
     )
     }
     ),
     "Data"
    )

    and your gallery Items

    Sort(
     Filter(
     ReportDetailsTable,
     (
     StartsWith(
     StaffEmail, 
     SearchInputBox.Text
     ) ||
     StartsWith(
     ID, 
     SearchInputBox.Text
     )
     ) &&
     Status.Value = "Pending" &&
     (
     'Dropdown category'.Selected.Value = "All" ||
     Category.Value = 'Dropdown category'.Selected.Value
     )
     ),
     Switch(
     varSortColumn,
     "SubmissionDate", 
     'Submission Date'
     ),
     varSortDirection
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • nayem Profile Picture
    75 on at

    The code works very well! 

    But I tried to apply on check status page and the code i applied look like this:
    Dropdown Code:

    Ungroup(
    Table(
    {Data: Table({Value: "All"})},
    {
    Data:
    Distinct(
    ReportDetailsTable,
    Status.Value
    )
    }
    ),
    "Data"
    )

     

    Gallery Code:

    Sort(
    Filter(
    ReportDetailsTable,
    (
    StartsWith(
    ID,
    SearchInputBox.Text
    )
    ) ||
    (

    ('Dropdown2_2'.Selected.Value = "All" && 'Created By'.Email = VarLoggedInUser) ||
    ('Dropdown2_2'.Selected.Value && 'Created By'.Email = VarLoggedInUser)

    )


    ),
    Switch(
    varSortColumn,
    "SubmissionDate",
    'Submission Date'
    ),
    varSortDirection
    )

    Somehow it did not show based on LoggedIn user, Please help.



  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    @nayem ,

    You do not have the field that Dropdown2_2 needs to match

    Sort(
     Filter(
     ReportDetailsTable,
     StartsWith(
     ID,
     SearchInputBox.Text
     ) && 
     'Created By'.Email = VarLoggedInUser && 
     (
     'Dropdown2_2'.Selected.Value = "All" ||
     YourFileNameHere = Dropdown2_2.Selected.Value
     )
     ),
     Switch(
     varSortColumn,
     "SubmissionDate",
     'Submission Date'
     ),
     varSortDirection
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard