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

How to set the dropdown value and display name

Hello,

 

I have a master table in sql and there is relationship Fk so i want to save the ID as value in the trasactnal table and want to display name to the user in form . 

 

How can i set a value as id to dropdown and name as display name of control in dropdown. I am not seeing any thing like it. 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to set the dropdown value and display name

Hi @Akumar,

Do you want to set Id as value to Dropdown and name as display name of control in Dropdown?

If you want to set the Id property value as selected value (Dropdown.Selected.Value) of the Dropdown control, along with the name as the display name of Dropdown control, I afraid that there is no way to achieve your needs in PowerApps currently.

I agree with @Drrickryp's thought almost. I have made a test on my side, please take a try with the following workaround:4.JPG

Set the Items property of the Dropdown control to following:

'[dbo].[Employees]'

On your side, you should type:

'[dbo].[YourSQLTable]' /* <-- Type your SQL Table */

Set the Value property to a column in your SQL table, which you want to display within the Dropdown control.

If you want to get/reference Id property value of selected value within the Dropdown control (Dropdown1), please take a try with the following formula:

Dropdown1.Selected.Id

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: How to set the dropdown value and display name

Hi @Akumar,

dropdown.PNGThe dropdown control actually selects an entire record.  You can display any of the fields by selecting the dropdown control and going to the advanced section on the right hand side of the screen.  Click on the value dropdown and choose the field that you want to display.  You can reference any field in the record selected in dropdown control anywhere in the app.  Place a label anywhere and set the Property to Dropdown1.Selected. and the list of fields will pop up for you to choose from.  If you want to filter a gallery you could reference the ID field of the dropdown as a foreign key in a second datasource.  For example if you wanted to filter a gallery based on another datasource, you would set the datasource as Filter(DS2,ID=Dropdown1.Selected.ID) and this would show all of the child records for the datasource in the dropdown control. example.PNGIn the example, all of the Orders made by the customer rep selected in the dropdown are shown in the datatable.  

Community Support Team
Community Support Team

Re: How to set the dropdown value and display name

Hi @Akumar,

Do you want to set Id as value to Dropdown and name as display name of control in Dropdown?

If you want to set the Id property value as selected value (Dropdown.Selected.Value) of the Dropdown control, along with the name as the display name of Dropdown control, I afraid that there is no way to achieve your needs in PowerApps currently.

I agree with @Drrickryp's thought almost. I have made a test on my side, please take a try with the following workaround:4.JPG

Set the Items property of the Dropdown control to following:

'[dbo].[Employees]'

On your side, you should type:

'[dbo].[YourSQLTable]' /* <-- Type your SQL Table */

Set the Value property to a column in your SQL table, which you want to display within the Dropdown control.

If you want to get/reference Id property value of selected value within the Dropdown control (Dropdown1), please take a try with the following formula:

Dropdown1.Selected.Id

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,424)