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

Re: Several buttons to control text input similar to Radio Buttons

@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

Highlighted
Super User III
Super User III

Re: Several buttons to control text input similar to Radio Buttons

@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
Highlighted
Super User III
Super User III

Re: Several buttons to control text input similar to Radio Buttons

@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

Highlighted
Frequent Visitor

Re: Several buttons to control text input similar to Radio Buttons

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?

Highlighted
Super User III
Super User III

Re: Several buttons to control text input similar to Radio Buttons

@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."

Highlighted
Frequent Visitor

Re: Several buttons to control text input similar to Radio Buttons

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!

 
Highlighted
Super User III
Super User III

Re: Several buttons to control text input similar to Radio Buttons

@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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,902)