Power Platform Tidbit #5 – What events are available in model-driven apps

Model-driven Power Apps can notify your code when certain events happen in the following parts of your apps.

  • Form
    • OnLoad – when form loads.
    • OnSave – when data is saved.
  • Tab
    • TabStateChange – when a tab expands or collapses.
  • Column
    • OnChange – when data changes in the column and its control loses focus.
  • IFrame –
    • OnReadyStateComplete – when the content of IFrame is fully loaded.

Hints!

  • TabStateChange is the best event to set the src property of an IFrame in a tab. If you otherwise do it in OnLoad event for a an IFrame that is in a collapsed tab, it will be overwritten when the tab expands!
  • OnChange happens immediately for Yes/No buttons that are formatted to use checkbox or radio buttons.
  • OnChange happens also when the data is changed on the server and the form refreshed (e.g. after a record is saved).
  • You can also trigger OnChange by calling attribute.fireOnChange.
  • Make sure to read the official docs about OnChange events. They can be tricky.
  • Try to always stick with these main events, but you can find all events that are available to you in JavaScript in here.

Reference: Configure model-driven app form event handlers


Posted

in

by

Comments

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.