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 / OnSelect not firing on...
Power Apps
Answered

OnSelect not firing on certain screen

(0) ShareShare
ReportReport
Posted on by 57

I have a screen where no OnSelect events will fire, though the Powerapps studio, web or mobile.  

 

It is a simple statement CalMonthCurrentDate.Text = "1", Originally it was CalMonthCurrentDate.Text = Text(DateValue(StartDate)+6, ShortDate).  I shorted it to eliminate variables.

 

I've wired many different controls with this statement and none of them work.  If I put a Navigate instead, that works fine. 

 

Any suggestions?  Is there any advanced way to debug these?

 

Thanks

Categories:
  • Brian Dang Profile Picture
    3,976 on at

    Perhaps it is that DateValue only works on Text. You can try reversing the order that you have it:

    DateValue(Text(StartDate,"mm/dd/yyyy"))
  • Verified answer
    rgruian Profile Picture
    Microsoft Employee on at

     

    I am trying to understand what you are hoping to do in that OnSelect property. You mentioned a "statement" "CalMonthCurentDate.Text = 1 " -- are you trying to force a value into a property of a control, imperatively? (i.e. "set" the property?)

     

    If that is what you are trying to do, PowerApps does not work that way. The "=" operator is an equality operator, not an assignment operator. Unlike imperative languages like JS, C++, Java, C#, etc. where you tell objects what to do, PowerApps's expression language is a declarative dataflow language, in which you declare what data flows into each property, and how it needs to be transformed on its way into the property. This is very similar to how Excel formulas work: you declare how each cell's value needs to be computed; and the dataflow engine does the rest of the work, iteratively flowing data where it needs to go, and evaluating all affected formulas to a steady state.

     

    If the goal is to set the Text property of CalMonthCurrentDate to "1", you will need to declare that value ("1") as the default value flowing into the control. For example for a Textbox control, bind its Text property to "1". For a TextInput control, bind its Default property to "1". If you are dealing with a stateful control, such as a TextInput control, and you want to "reset it" to some value such as "1" from an OnSelect property of another control, you need to pulse the Default property from that formula:

     

        TextInput1.Default = DefaultValue

        Button123.OnSelect = UpdateContext({DefaultValue: ""}); UpdateContext({DefaultValue: "1"})

     

    Please see the formula reference for more information.

    https://powerapps.microsoft.com/en-us/tutorials/formula-reference/

     

    I hope this helps.

     

     

     

  • WAstarita Profile Picture
    57 on at

    I did not realize that, with your suggestion it now works perfectly.

     

    Thanks

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard