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

Several buttons to control text input similar to Radio Buttons

I'm Trying to figure out how to make 3 buttons control one text input and only allow input from 1 button (exactly like what a radio button control does). Here is what I have currently but it doesn't clear the previous buttons entry. For example: if I click yes, but then change my mind and press No, both the text Yes and No are combined and Im not sure how to clear the previous. 

 

Each button has this for the OnSelect=UpdateContext({Var1:"Yes"}) or "No" or "N/A"

Text input field  Default=Var1&Var2

 

My overall goal is to clean up my screen so its not so busy with all the radio buttons. Radio buttons work great but don't look great. If you have any other suggestions that would be greatly appreciated!

2 ACCEPTED SOLUTIONS

Accepted Solutions
mdevaney
Super User III
Super User III

@User1234 

It would be more work to create buttons but it is possible

 

#1 Put this code in the OnVisible property of your screen

Set(q1Yes,false);
Set(q1No,false);
Set(q1NA,false);

 

#2 Put this code in the OnSelect property of the Yes button

Set(q1Yes,true);
Set(q1No,false);
Set(q1NA,false);

 

#3 Put this code in the OnSelect property of the No button

Set(q1Yes,false);
Set(q1No,true);
Set(q1NA,false);

 

#4 Put this code in the OnSelect property of the NA button

Set(q1Yes,false);
Set(q1No,false);
Set(q1NA,true);

 

#5 Put this code in your Edit Form Update field OR or the record's Q1 field name if using PATCH

If(
    q1Yes,"Yes",
    q1No,"No",
    q1NA,"NA"
)

 

Of course you are going to have to code the Color & Fill properties of each button to indicate when a button is Selected.  Good luck!

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

@User1234 

Here's the complete list of properties I would use to do this.  There doesn't appear to be any setting for button spacing directly.

Color: RGBA(0, 0, 0, 0)
Size: 0
RadioSize: 30 //Optional

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

5 REPLIES 5
mdevaney
Super User III
Super User III

@User1234 

It would be more work to create buttons but it is possible

 

#1 Put this code in the OnVisible property of your screen

Set(q1Yes,false);
Set(q1No,false);
Set(q1NA,false);

 

#2 Put this code in the OnSelect property of the Yes button

Set(q1Yes,true);
Set(q1No,false);
Set(q1NA,false);

 

#3 Put this code in the OnSelect property of the No button

Set(q1Yes,false);
Set(q1No,true);
Set(q1NA,false);

 

#4 Put this code in the OnSelect property of the NA button

Set(q1Yes,false);
Set(q1No,false);
Set(q1NA,true);

 

#5 Put this code in your Edit Form Update field OR or the record's Q1 field name if using PATCH

If(
    q1Yes,"Yes",
    q1No,"No",
    q1NA,"NA"
)

 

Of course you are going to have to code the Color & Fill properties of each button to indicate when a button is Selected.  Good luck!

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Thank you very much! And wow, that would be a ton of work because there are 50+ questions. Is there a way to "Hide" the text field next to a radio button and have that button still work properly? When I remove the text it doesn't populate my text input, because I assume it is also tied to the value?

@User1234 

Dead simplest way is to update the Color property to transparent

 

RGBA(0, 0, 0, 0)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

You have been very helpful and I greatly appreciate it! That is a great idea, but because there is text, there are large gaps between the radio buttons themselves. Any idea how to squish them closer together? Thanks again!

 

@User1234 

Here's the complete list of properties I would use to do this.  There doesn't appear to be any setting for button spacing directly.

Color: RGBA(0, 0, 0, 0)
Size: 0
RadioSize: 30 //Optional

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (75,548)