web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Switching toggle based...
Power Apps
Answered

Switching toggle based on onchange of the text field

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I have a edit form in my power apps. There are 2 fields that are important for this subject:

1. Toggle switch called comments modified  - represented in my form by DataCardValue71

2. Text field called comments - represented in my form by DataCardValue72

 

What I would like to do is whenever comments field is changed (even if somebody will remove one letter or add dot) the toggle switch is set to true. Basically what I was testing is to change the OnChange property of the Comments field to something like DataCardValue71.Value = true, but it's not working. Can you please advice?

Categories:
I have the same question (0)
  • ASHetap Profile Picture
    138 on at

    I think you want to set the DataCardValue71.Default not DataCardValue71.Value

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Evastor_0-1654075309812.png

     

    This is not working for the text field of comments

  • Verified answer
    ASHetap Profile Picture
    138 on at

    I have fiddled with it myself and the quickest solution i found was on the Onchange property of the text input define a variable like below

    Set(TextboxChanged, true)

     

    and reference that variable in the toggle Defauolt property

    ASHetap_0-1654076068143.png

    hope this satisfies all your needs, if it works please mark this as answer

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks 🙂 

     

    I found similar solution in the meantime that I will share here. If there any possible issues that I may expect with it please let me know, but so far works well 🙂

     

    So what I did is on the onchange property of DataCardValue72 I put: UpdateContext({varComments: true}). After that on the default property of the toggle button DataCardValue71 I wrote If(varComments = true, true, Parent.Default). In case somebody is not saving the changes or going back to other screen I also added UpdateContext({varComments: false}) to those buttons

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard