cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lstan
Level: Powered On

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
Super User
Super User

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
Super User
Super User

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
lstan
Level: Powered On

Re: Filter in a Gallery

Hi @timl,

 

It worked using Value() function.

 

Thank you Smiley Happy

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,946)