cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ajhstn
Helper I
Helper I

Hashtable, key-value pairs?

Hello, this request seems incredibly common and simple, but i just cannot work out how to do it or find any documentation/articles.

 

I want to have a dropdown list with options, say a, b and c.  I need each option to have a value other then the name iteslf, eg a=1, b=2, c=3.  When the user selects a, i need to pass the value of 1 down to my flow, if they select b, i need to pass the value of 2 down to my flow.

1 ACCEPTED SOLUTION

Accepted Solutions
R3dKap
Super User
Super User

Hi @ajhstn, did you manage to make our suggestion to work ?

View solution in original post

4 REPLIES 4
R3dKap
Super User
Super User

Hi @ajhstn,

You could create a collection with two columns: one for the label a, b, c and one for the number 1, 2, 3:

ClearCollect(colOptions,{Label="a",Value=1},{Label="b",Value=2},{Label="c",Value=3})

After that, set your dropdrown Items property to colOptions and choose the Label field as the display field.

Then, when you want to start your flow, get the value for the selected label like this:

ComboBox1.Selected.Value

Hope this helps,

Emmanuel

Hi thank you.  I think i have worked it out, but do i "create" the collection on the Dropdown.OnSelect or some other property?

 


You could create a collection with two columns: one for the label a, b, c and one for the number 1, 2, 3:

ClearCollect(colOptions,{Label="a",Value=1},{Label="b",Value=2},{Label="c",Value=3})

 

RezaDorrani
Dual Super User II
Dual Super User II

Hi @ajhstn 

 

Load the collection on OnStart of the App or OnVisible of the Screen

ClearCollect(colOptions,{Label:"a",Value:1},{Label:"b",Value:2},{Label:"c",Value:3})

 

Then for dropdown set Items property to colOptions and the Value property of the dropdown to Label

 

When sending data to Flwo, since you want to send the id

use dropdown.Selected.Value 

where dropdown is the name of your dropdown control

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

 

R3dKap
Super User
Super User

Hi @ajhstn, did you manage to make our suggestion to work ?

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,259)