I want to filter data in a gallery connected to a SQL database by the City column using a text input. Then I want to enter the City in the text input and then populate all the Zip Codes in that City, along with data from the remaining columns.
The columns that are querying from a SQL database are: Zip Code, House Number, Street Name, and City. This is what I'm seeing when I enter this code:
Sort(Filter(sqlDatabase,StartsWith('City',searchInput.Text)),Zip Code,SortOrder.Descending)
| Zip Code | House Number | Street Name | City |
| 78451 | 456 | Holmes Ave | Chicago |
| 78451 | 456 | Holmes Ave | Chicago |
| 78451 | 456 | Holmes Ave | Chicago |
| 78469 | 4895 | Richard St. | Chicago |
| 78469 | 4895 | Richard St. | Chicago |
| 78466 | 2387 | Harwich Ave | Chicago |
| 78466 | 2387 | Harwich Ave | Chicago |
| 78466 | 2387 | Harwich Ave | Chicago |
| 78466 | 2387 | Harwich Ave | Chicago |
| 78481 | 65 | Birdeye Lane | Chicago |
| 78481 | 65 | Birdeye Lane | Chicago |
| 78435 | 562 | 24 W 14th | Chicago |
It's pulling in duplicates. I want to remove the duplicates.
I would like the gallery in my Power Apps form to show the following when I filter by City:
| Zip Code | House Number | Street Name | City |
| 78451 | 456 | Holmes Ave | Chicago |
| 78469 | 4895 | Richard St. | Chicago |
| 78466 | 2387 | Harwich Ave | Chicago |
| 78481 | 65 | Birdeye Lane | Chicago |
| 78435 | 562 | 24 W 14th | Chicago |
As you can see the duplicates are not there.
I know that I cannot use the Distinct function because it will only return the values of one column.
Is there a formula I can use to remove the duplicates when filtering by city as shown in the second table?
Any advice can help. Thanks!