web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Setting the Default va...
Power Apps
Unanswered

Setting the Default value in a Gallery

(0) ShareShare
ReportReport
Posted on by 82

Hello

 

I have a filter gallery on my form and I am looking to set one of the values as the default.

 

For example:

 

Calcelled

Late

New <- I want to set New as the default

Closed

 

Items code uses a collection and works perfectly

Gallery > Items > Sort(Distinct(EmpCollection, 'Employee Status'.Value),Result,Ascending)

 

Default code does not work

Gallery > Default > LookUp(EmpCollection, 'Employee Status'.Value="New")

 

Error message - Invalid Formula. Expected a value compatible with 'Items'

 

 

Any suggestions?

 

Thanks,

Yoshi

 

Categories:
I have the same question (0)
  • Ramole Profile Picture
    Super User 2024 Season 1 on at
    Re: Setting the Default value in a Gallery

    Hi @Yoshimitsu411 

    This post will explain how to do it 
    How to set default item in a Gallery 

    Gallery control in Power Apps 

  • Yoshimitsu411 Profile Picture
    82 on at
    Re: Setting the Default value in a Gallery

    Thanks @Ramole I tried that link and a few others before posting to this forum. Unfortunately, it doesn't work.

     

  • Verified answer
    Yoshimitsu411 Profile Picture
    82 on at
    Re: Setting the Default value in a Gallery

    I fixed it.

     

    Based on the error message "Invalid Formula. Expected a value compatible with 'Items'", the formula is looking for a record, so I simply wrapped my Items code in a Lookup.

     

    Gallery default code now looks like this.

     

    LookUp(Sort(Distinct(EmpCollection, 'Employee Status'.Value),Result,Ascending), Result="New")

     

    Thanks

    Yoshi

  • Golly Profile Picture
    127 on at
    Setting the Default value in a Gallery
    Yoshimitsu411's fix worked for me, even though I have an if() statement in my Gallery.items! 
     
    Weird.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 836 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 231 Super User 2025 Season 2

Last 30 days Overall leaderboard