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 / Setting the Default va...
Power Apps
Answered

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:
  • Ramole Profile Picture
    Super User 2024 Season 1 on at
  • Yoshimitsu411 Profile Picture
    82 on at

    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

    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
    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard