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 / DefaultValue formula e...
Power Apps
Answered

DefaultValue formula error: invalid formula expected a value compatible with items

(0) ShareShare
ReportReport
Posted on by 1,146

Thank you for taking the time to read my question.

 

I have a gallery that gets it's Items from a Collection. I want to set the default value of this gallery because I have another gallery that is filtered based on the first gallery's selected item. The Collection only has one record ever.

 

I tried the following formula but got the error: invalid formula expected a value compatible with items

 

The formula works great for a Label.

 

I have not been able to find a similar error message on line, most say "Datasource" instead of "items".

 

Formula: First(FacilityAccess).FacilityList

 

Thanks again for your help.

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @iwonder 

    Your Default property must match the schema of the Items property.

    If that doesn't provide a clue, then post your Default and your Items formulas to start.

     

    I hope this is helpful for you.

  • iwonder Profile Picture
    1,146 on at

    Hi @RandyHayes 

     

    Thank you very much for your reply. I must admit, I'm not sure what you mean by Schema.

     

    Note: I just realized I stated incorrectly that there is only one record in my Collection "FacilityAccess" I meant there is only one Column.

     

    Gallery1_2 (I'll be renaming this shortly)

    Items: FacilityAccess.FacilityList

    Default: First(FacilityAccess).FacilityList

     

    If I add a label to my screen

    Label2.Text = First(FacilityAccess).FacilityList

    Gallery1_2.Default = Lookup(FacilityAccess,FacilityList = Label2.Text)

    This works.... but I don't understand why.

     

    Thanks

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @iwonder 

    This is because your Default is a Text value and you need to supply a Record to the Default for a Gallery.

    So, either change your Items property to : FacilityAccess

    Or change your Default to : {FacilityList: LookUp(FacilityAccess,FacilityList = Label2.Text, FacilityList)}

    Which will then be a record with the corresponding schema of your Items property.

  • iwonder Profile Picture
    1,146 on at

    Thank you very much @RandyHayes 

     

    My final solution is

     

    Gallery.Items = Filter(FacilityLines,Facility = Gallery1_2.Selected.Title1_2.Text)

     

    Thanks!

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
WarrenBelz Profile Picture

WarrenBelz 429 Most Valuable Professional

#2
11manish Profile Picture

11manish 191 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 122 Super User 2026 Season 2

Last 30 days Overall leaderboard