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
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
Frequent Visitor

Re: Filter in a Gallery

Hi @timl,

 

It worked using Value() function.

 

Thank you Smiley Happy

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,692)