cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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

@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
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (53,307)