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

link a toogle to a text field

Hello

On an edit form, I put a toggle button.
I am connected to a sql server database on a "task" table
I have a "status" field that is required in the database.
I would like that when I open the screen (with a database record, a task), the status value was retrieved on the "status" field and, if the status is "done", the toogle button is checked and if the value is "to do", the toogle is unchecked.
After that, if you change the toogle value, the "status" field also changes.
In short, I would like to replace my text field which can take two values (done, to do) by a toogle and that it is updated in the database
Could you help me, please?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: link a toogle to a text field

Hi @zerony

 

You can hide the status text input and change the TextInput.Default to

If(Toggle1.Value,"done","to do")

Change the Toggle.TrueText to "done", and the false text to "todo"

 

Make sure that the toggle is in the same card as the text input by unlocking the card on the right hand pane

 

On the Toggle1.Default you can specify 

If(Parent.Default="done",true, false)

 

I hope I didn't miss anything, please let me know if you don't come right.

 

View solution in original post

3 REPLIES 3
Super User
Super User

Re: link a toogle to a text field

Hi @zerony

 

You can hide the status text input and change the TextInput.Default to

If(Toggle1.Value,"done","to do")

Change the Toggle.TrueText to "done", and the false text to "todo"

 

Make sure that the toggle is in the same card as the text input by unlocking the card on the right hand pane

 

On the Toggle1.Default you can specify 

If(Parent.Default="done",true, false)

 

I hope I didn't miss anything, please let me know if you don't come right.

 

View solution in original post

zerony
Frequent Visitor

Re: link a toogle to a text field

It works! Thank

Super User
Super User

Re: link a toogle to a text field

Awesome, have a great day.

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (8,431)