cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
spow5666
Frequent Visitor

Pass value from radio button to filter drop down box

Working on my timesheet app. I want users to choose from a radio button on the 'Enter Time' screen which indicates whether they will enter 'Work Time' or 'Non-Work Time'.  Those two values come from Excel table TimeType.Time_Description. 

 

I want to pass the selected value to a dropdown list which has AllowedValues property:  DataSourceInfo([@WBS], DataSourceInfo.AllowedValues, "WBS_Code")

 

On the Excel table WBS the dropdown's values come from, there is also Time_Type which has values the same as TimeType.Time_Description so I want to use that to filter the values available in the dropdown list.

 

I set the radio button's OnSelect property to:  Set(Var_Time_Type,TimeType.Time_Description) in the hope that I could then filter or somehow pass that variable to the dropdown list's AllowedValues property. 

 

Any suggestions would be appreciated (including a completely different way of doing it).

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @spow5666 ,

Could you please share a bit more about your scenario?

Do you want to filter the Dropdown box options based on the selected Radio button value?

 

I have made a test on my side, please consider take a try with the following workaround:

Set the Items property of the Radio control (Radio1) to following:

TimeType.Time_Description

Set the Items property of the Dropdown box (Dropdown1) to following:

Distinct(
         Filter([@WBS], Time_Type = Radio1.Selected.Time_Description),
         WBS_Code
)

Please consider take a try with above solution, then check if the issue is solved.

 

If the Dropdown box is included within a Edit form, and you want to save the selected value back to your data source, please set the Update property of the Data card which contains the Dropdown box to following:

Dropdown1.Selected.Result

 

Best regards,

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
v-xida-msft
Community Support
Community Support

Hi @spow5666 ,

Could you please share a bit more about your scenario?

Do you want to filter the Dropdown box options based on the selected Radio button value?

 

I have made a test on my side, please consider take a try with the following workaround:

Set the Items property of the Radio control (Radio1) to following:

TimeType.Time_Description

Set the Items property of the Dropdown box (Dropdown1) to following:

Distinct(
         Filter([@WBS], Time_Type = Radio1.Selected.Time_Description),
         WBS_Code
)

Please consider take a try with above solution, then check if the issue is solved.

 

If the Dropdown box is included within a Edit form, and you want to save the selected value back to your data source, please set the Update property of the Data card which contains the Dropdown box to following:

Dropdown1.Selected.Result

 

Best regards,

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.

@v-xida-msft  thanks very much.  Your suggestions have worked perfectly. 

PS: I've also deleted the Radio button's OnSelect formula in which I originally created a variable as it's no longer required.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,803)