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 / Initializing variables...
Power Apps
Unanswered

Initializing variables within a component from the component screen

(0) ShareShare
ReportReport
Posted on by 3

I was watching this video by April Dunham where she shows how to use her calendar component and I noticed that she initializes variables within the component using the OnStart property of a timer that's set to auto start. This is a gamechanger to me because that means you can make components that don't require any code outside of them to set them up. 

 

The problem is, when I've tried this trick myself in my own components the timer does not start. It only gets triggered by navigating to a screen with the component on it, but April's component initializes itself from the component screen and I haven't been able to replicate that. Does anybody know how to do this?? Any help would be great! 

Categories:
  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Perhaps @aprildunnam can help? 😉

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Not sure if you have tried this, but would it not be something like adding a Context or Variable to the Timer Start property?

     

    So, OnVisible of the screen use something like: UpdateContext({pauseTimer: false});  Then the timer Start property gets 'pauseTimer' and every time you set UpdateContext({pauseTimer: true}); the timer will start.

     

    This also means you need to set OnTimerEnd to be UpdateContext({pauseTimer: false}); Reset(timerName);

     

     

     

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 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 130

Last 30 days Overall leaderboard