cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
venka91
Helper V
Helper V

Need Radio button value based on Result

Dear All,

Building an hospital canvas app and i need to calculate the BMI. I have placed text boxes to input weight and height. the BMI formula is used and the result will be showed in another text box. 

 

Based on the value shown on the BMI text box, i want to have the radio button selected automatically.

 

Also, if this cannot be done using radio button, i will show them on the another label box about BMI comments as "Normal" or "Obese" etc.

 

could any one please help as i could not able to make this work. Attaching screenshot.

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @venka91 ,

 

I did a simple test for you.

 

1\ Add 3 textinput control .'TextInput1', 'TextInput2', 'TextInput3'.

 

2\ Set Default property of 'TextInput3' to:

Value(TextInput1.Text)-Value(TextInput2.Text)

 

/*

I assume:

If the value is less than 100, it is the first option.

If the value is between 100-500, it is the second option.

If the value is greater than 500, it is the third option.

*/

 

3\ Add a radio control 'Radio1' and set its Items property to:

["AAA","BBB","CCC"]

 

Set the radio control's Default property to:

If(Value(TextInput3.Text)<100,"AAA",
   Value(TextInput3.Text)<500 && Value(TextInput3.Text)>100,"BBB",
   Value(TextInput3.Text)>500,"CCC")

 

4\ Set 'TextInput1' 's onchange property to:

Reset(Radio1)

 

5\ Set 'TextInput2' 's onchange property to:

Reset(Radio1)

 

6\ The result is as follows:

AAA.gif

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

View solution in original post

gabibalaban
Super User II
Super User II

Hi @venka91 ,

Set the default property of the radio control to something similar to:

 

With({BMI_Value:Value(BMI_TextInput.Text)},
 If(
    BMI_Value < UnderWeightSuperiorLimitValue,
    "UnderWeight",
    BMI_Value < NormalWeightSuperiorLimitValue,
    "NormalWeight",
    BMI_Value<OverWeightSuperiorLimitValue,
    "OverWeight",
    "Obese"
 ) 
)

 

where ...SuperiorLimitValue are standard BMI value under which the pacient is considered in category. This values can be hardcoded in formula or you can use variable to define them.

 

Hope it helps !

View solution in original post

4 REPLIES 4
v-xiaochen-msft
Community Support
Community Support

Hi @venka91 ,

 

I did a simple test for you.

 

1\ Add 3 textinput control .'TextInput1', 'TextInput2', 'TextInput3'.

 

2\ Set Default property of 'TextInput3' to:

Value(TextInput1.Text)-Value(TextInput2.Text)

 

/*

I assume:

If the value is less than 100, it is the first option.

If the value is between 100-500, it is the second option.

If the value is greater than 500, it is the third option.

*/

 

3\ Add a radio control 'Radio1' and set its Items property to:

["AAA","BBB","CCC"]

 

Set the radio control's Default property to:

If(Value(TextInput3.Text)<100,"AAA",
   Value(TextInput3.Text)<500 && Value(TextInput3.Text)>100,"BBB",
   Value(TextInput3.Text)>500,"CCC")

 

4\ Set 'TextInput1' 's onchange property to:

Reset(Radio1)

 

5\ Set 'TextInput2' 's onchange property to:

Reset(Radio1)

 

6\ The result is as follows:

AAA.gif

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

View solution in original post

gabibalaban
Super User II
Super User II

Hi @venka91 ,

Set the default property of the radio control to something similar to:

 

With({BMI_Value:Value(BMI_TextInput.Text)},
 If(
    BMI_Value < UnderWeightSuperiorLimitValue,
    "UnderWeight",
    BMI_Value < NormalWeightSuperiorLimitValue,
    "NormalWeight",
    BMI_Value<OverWeightSuperiorLimitValue,
    "OverWeight",
    "Obese"
 ) 
)

 

where ...SuperiorLimitValue are standard BMI value under which the pacient is considered in category. This values can be hardcoded in formula or you can use variable to define them.

 

Hope it helps !

View solution in original post

Thank you so much. solution worked very well.

Worked like a charm.

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,065)