cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
powerappstx
Regular Visitor

Dropdown: Text (display) and Value (pass)

Hi,

 

I have a dropdown control which pulls data from a SharePoint list. I would like the dropdown box to display the city name (City.Name) and pass the value of that city name (City.ID) onto a gallery, which will be filtered based on the City.ID, not the City.Name.

 

In the "Advnaced" tap for the dropdown, I've tried to set the Items to City.Name and the Value to City.ID, but when I set the Item to the Name, it forces the Value to Name as well, and won't let me manually set the Value. I've tried several other solutions I've found on the forums and don't seem to grasp what I am doing wrong. Can someone please point me in the right direction?

 

Thank you.

5 REPLIES 5
yashag2255
Dual Super User II
Dual Super User II

Hey @powerappstx 

 

In that case, update the configuration to:
 
1) Dropdown -> Items -> City
2) Select Value as Name from the fields in the right menu.
3) To get Id for selected city, use the expression: Dropdown1.Selected.ID
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

This is my configuration:

 

Dropdown box:

Items: Portfolio.Store (ex: New York, NY)

Default Value: MyDept (which is global variable. ex: "1000")

 

My problem is when I go to change the "Value" for the dropdown it only shows "Store" as an option. I'm allowed to change it.

 

Untitled.png

 

Hey @powerappstx 

 

Portfolio.Store restricts to one column of this Portfolio data source. You need to update the configuration as:
 
Items: Portfolio
Value: Store
 
To retrieve the value, you need to use: Dropdown1.Selected.ID
ID is the name of column you want to retrieve.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

If yashag2255's reply doesn't fit for your scenario, you could try using a combo box. These objects are much more flexible. 

Right, so this gets me back to where I was. 

 

Dropdown:

Items = Portfolio

Selected = ID

 

However, I would like the Display value of DropDown to equal a friendly name vs the ID.

 

Example:

City Table (SharePoint):

City Name:       ID:

New York         1000

Boston              2000

 

MyDept (Global Varible, O365 Dept Value)

 

I'd like this behavior:

 

DropDown:

Item Display = CityTable.City Name

Item Value = CItyTable.ID

Selected = MyDept

 

Essentially, I want the MyDept value to do a lookup into the City Table and display the City Name, not the City ID.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,420)