Showing results for 
Search instead for 
Did you mean: 
New Member


A user should input data to a textinput to search for a company. A gallery then searches for the input in a SQL table which is then display with help of a textinput. Depending on the value of an dropdownbox, it decides which table it should search for. The problem arises when I write an if-statement to decided which table it should search for.


When not including an if statement but only searching in one table, it is successful. As you can see below, the user searches for a company, with the help of a gallery and text input the result can be shown.  The gallerywalk searches in the table "FTG_Namn" and the textinput shows the data with the help of the variable "This.Item".








However, when adding complexity to it where I want to search in different tables depending on a dropdown, it does not work. So when the dropdownbox (title is "type") is blank, it should search in the table "FTG_NAMN" and if it holds another value it should search in the table "Fieldsofplay". So I wrote an if-statement in both the gallery and the textinput for it to know how it should behave. And also depending on the value on the dropbox, it should also take the value "ThisItem.FTG_NAMN" or "ThisItem.FieldsofPlay". 






Does someone have a solution to how you could get the gallery and text input to behave as intended? 


Best regards,



Super User II
Super User II

Hi @Sadde,

Dont think this can be done with 1 gallery as the properties of the elements of each gallery could be different.

That being said, what you can do is have 2 galleries on the same page and control the visibility fo each gallery based on the value of the dropdown. Gallery1 can have table1 as the data source and Gallery2 can have table2 as the data source.

For example,

Gallery1 visibility: If(Dropdown.Selected.Value =1, true, false)

Gallery2 visibility: If(Dropdown.Selected.Value =2, true, false)

Keep the label as is. This should give you what you are trying to achieve with 1 gallery.

Please let me know if this helps and mark the answer as solution. Thanks!

Helpful resources

PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!


Are Your Ready?

Test your skills now with the Cloud Skill Challenge.


Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (58,892)