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 / If statement in items ...
Power Apps
Answered

If statement in items property expects a record but returns a table, I need a table for the items list.

(0) ShareShare
ReportReport
Posted on by 4

Hi can't seem to find a solution to this one.

I have two statements that work independently in the items property of a dropdown menu. 

When I connect the two statement using an If function, I get an error on the filter half of the if statement saying a table was returned when it expected a record. 

I want the returned table from the filter function to be my items in the items property of the drop down menu. 

Here is the code that is giving me the issue.

If(
ItemClick="true",

LookUp(ItemData,Item=Dropdown2.SelectedText.Item), // This line works

Filter(ItemData,Location=Dropdown2_1.Selected.Locations)) // This works by itself but not inside this if statement.

 

All help is appreciated.

 

Categories:
  • Verified answer
    shoog Profile Picture
    2,164 on at

    LookUp returns a single record while Filter returns a table, so that's why you can't combine the two. The If statement should return the same datatype for the true and false parts.

     

    You can change the LookUp to a Filter to solve this:

    If(ItemClick="true",
     Filter(ItemData,Item=Dropdown2.SelectedText.Item),
     Filter(ItemData,Location=Dropdown2_1.Selected.Locations)
    )
  • JDG-VES Profile Picture
    4 on at

    Thanks so much, learn something new everyday. Good to know the data type for both halves of the if statement have to be the same.

     

    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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard