The OnChange trigger is another common trigger used in canvas apps, which fires when the value of a control changes. This trigger is used to perform actions when a user enters data into a control, such as a text input, a dropdown, or a date picker.
The OnChange trigger allows you to specify actions that should be performed when the value of a control changes. For example, you might use the OnChange trigger to update a data source or to show or hide certain controls based on the user’s input.
To use the OnChange trigger in a canvas app, you first need to select the control that you want to use it with. Then, in the formula bar, you can enter a formula that defines the actions that should be performed when the value of the control changes. The formula should start with the name of the control, followed by a period and the OnChange property.
For example, if you have a text input control named “TextInput1”, you can define the OnChange trigger for that control by entering the following formula in the formula bar:
TextInput1.OnChange = UpdateContext({MyVariable: TextInput1.Text})
In this example, the OnChange trigger for the TextInput1 control updates a context variable named “MyVariable” with the current value of the text input.
The OnChange trigger is a useful feature that allows you to create dynamic and responsive canvas apps. However, like the OnSelect trigger, it’s important to use it judiciously and only when necessary, as too many triggers can make your app slow and difficult to maintain.