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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Changing another objec...
Power Apps
Unanswered

Changing another object property with a button/ image click

(0) ShareShare
ReportReport
Posted on by

Hi

 

How can i play a sound and/or change another object's properties when "clicking" on a button/image (for example change the backcolor of a textbox when clicking a button)?

 

thank you!

Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    on at

    Hi dantept,

     

    One option to do that is to bind the property you want to change to a context variable that will be changed when the button is clicked. For example, if you want to change the background color of textbox, you'd set the Fill property to that variable:

     

    TextBox1.Fill: myColor

    And then on the OnSelect property of the button, you'd update the value. In the example below, the color is toggled between red and blue every time the button is pressed.

     

    Button1.OnSelect: UpdateContext({ myColor: If(myColor = Color.Red, Color.Blue, Color.Red) })

    You can also have an initial value for that variable, which would be normally set on the OnVisible property of the screen where the textbox and button are located:

     

    Screen1.OnVisible: UpdateContext({ myColor: Color.Red }) 

     

  • Community Power Platform Member Profile Picture
    on at

    Obrigado Carlos! Smiley Happy

  • Jsamano Profile Picture
    6 on at

    Hi, 

     

    Thanks for your reply, it enlightes me.

     

    What if I would try to set only the object selected inside of a vertical gallery?

     

    Thank you

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard