web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

undefined

(0) ShareShare
ReportReport
Posted on by

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".

 

try1.PNG

 

try2.PNG

 

try3.PNG

 

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". 

 

try4.PNG

 

try5.PNG

 

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

 

Best regards,

 

Sadde

Categories:
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    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!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard