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

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

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: 133 members 4,622 guests
Please welcome our newest community members: