cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Filter in a Gallery

Hi,

I have 2 tables: the first one is "Employees" and the second one is "Hobbies":
 employeetable.JPG
 
hobbiestable.JPG
In PowerApps I have a Gallery (Gallery1) with the Employees that can be selected:
 gall1.JPG
 
I created a second Gallery where I want to see all the hobbies for the selected Employee:
gall2.JPG
On Items, I put the following formula, but it has an incompatibility error:
 
Filter('[dbo].[Hobbies]',EmployeeID=Gallery1.Selected.EmployeeID)
 
incompatible.JPG
 
How can I change the Filter Formula in order to avoid this error?
 
Thank you!
 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Filter in a Gallery

Hi @lstan 

Can you confirm the data types of the EmployeeID columns in your tables? For example, if Employees.EmployeeID is type int and Hobbies.EmployeeID is type nvarchar, this could result in this error.

To resolve this type of problem, you can call the Value function to convert text values to numbers.

Filter('[dbo].[Hobbies]',
         Value(EmployeeID)=Value(Gallery1.Selected.EmployeeID) 
)

View solution in original post

2 REPLIES 2
Highlighted
Super User III
Super User III

Re: Filter in a Gallery

Hi @lstan 

Can you confirm the data types of the EmployeeID columns in your tables? For example, if Employees.EmployeeID is type int and Hobbies.EmployeeID is type nvarchar, this could result in this error.

To resolve this type of problem, you can call the Value function to convert text values to numbers.

Filter('[dbo].[Hobbies]',
         Value(EmployeeID)=Value(Gallery1.Selected.EmployeeID) 
)

View solution in original post

Highlighted
Frequent Visitor

Re: Filter in a Gallery

Hi @timl,

 

It worked using Value() function.

 

Thank you Smiley Happy

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,006)