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

Data from SQL Datasource to Dropdown Box (Filter and Select column)

If i have a Dropdown with the following items Fx: '[dbo].[tblTestes]'

It list the primary key (Code) in the dopdown.

 

tblTestes has the following columns:

Code

Name

Surname

Phone

 

How can i:

A - list the second column (Name) instead of the (Code) column

B - List the (name) column but filter all the results to a specific (Surname)

 

Thanks

 

1 REPLY 1
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Data from SQL Datasource to Dropdown Box (Filter and Select column)

For the first part: open the Advanced view in the right-side pane, and under "Items", you can choose the value that will be displayed in the dropdown. By default it chose the code column, but you can change it to display what you want (in your case, 'Name'), as shown below.

ForumPost001.PNG

 

For the secoond part: you can filter the data source using any column. For this example, I have a text input that the user can type to filter the data based on the surname. In the code below I used the Search function, but you can use the Filter function as well.

If(
    IsBlank(TextInput1.Text),
    '[dbo].[tblTestes]',
    Search('[dbo].[tblTestes]', TextInput1.Text, "Surname"))

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 181 members 5,616 guests
Please welcome our newest community members: