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

 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 652 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 410 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 236

Last 30 days Overall leaderboard