cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

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
Highlighted
Community Support
Community Support

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

3 REPLIES 3
Highlighted
Super User III
Super User III

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.  

Highlighted
Community Support
Community Support

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

Highlighted
New Member

Hello everybody, 

by accident I guess I figored it out. My solution is tested by using forms. 

 

1) Display the value like in the solution above

2) Use the "update" function of the parent datacard with "DataCardValue8.Selected.ID"

 

Should work, best regards

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,849)