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

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

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

Frequent Visitor

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!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,838)