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 / Refresh Toggle Control...
Power Apps
Unanswered

Refresh Toggle Controls with Refresher Timer

(0) ShareShare
ReportReport
Posted on by 19

Hello!

 

I have an app that features a number of training courses. Users click on a button and are brought to a Microsoft Forms quiz. If they pass, the training course is marked off as complete. It all works just fine, except users would have to navigate off the screen or close the app and reopen in order to see their training course update to complete. So I put a Timer on the screen to refresh the data every 5 seconds. I have multiple data sources--one for each course quiz and one for the training courses themselves. I have text on the screen linked to the  course quizzes that updates their score with the Timer. That works fine as well. However, the training course themselves do not get checked off as complete. I see in the data (SharePoint List) that the course should be checked off, but it's not refreshing like the course quiz scores. The code for the refresher timer is the same as the course quizzes. I figure it has something to do with the toggle control that I am using to show users a course is checked off. The refresh timer just isn't updating the toggle control. Any help would be greatly appreciated. 

Categories:
I have the same question (0)
  • joe_hannes_col Profile Picture
    1,843 Super User 2024 Season 1 on at

    Hello @sironman,

     

    Could you please share the code used to set your toggle controls?

  • sironman Profile Picture
    19 on at

    I'm not sure which code you need to see. Here's the Timer Refresh Code:Refresh TimerRefresh TimerHere's the default value for the Toggle Control:Default Value for ToggleDefault Value for ToggleAnd here are some of the properties for the Toggle control:

    Toggle Control PropertiesToggle Control PropertiesToggle Control PropertiesToggle Control Properties

     

  • joe_hannes_col Profile Picture
    1,843 Super User 2024 Season 1 on at

    Thank you @sironman.

    Not quite sure I'm understanding how your app is set up. Is the toggle part of a form that uses "MY Training Plan" as a source? If so, could you please share the Data source and Item properties of your form?

    And this is not what you were asking for, but your OnCheck and OnUncheck properties are probably not working as intended. To set the value for DatacardKey1_2.Text, you will have to set the "Text" property of the control DatacardKey1_2 to something like: 

    If(DGMQOverviewValue.Value,"Completed on " & Today(),"Not yet completed")

     

  • sironman Profile Picture
    19 on at

    Yes, the toggle part of the form uses "MY Training Plan," which is a SharePoint List as its data source. 

     

    varCurrentRecord is the variable I am using to track what training plan the user clicked on from a collection on a previous screen.

     

    Here is the Form Data source info:

    Form.PNGForm2.PNG

     

    And thanks for the advice about the OnCheck and OnUnCheck properties. I did something similar to what you suggest. That must be leftover from an earlier version. Users don't even really interact with these toggles anymore. They are just for show. The only way to check off a course is to complete the quiz. The user can't click on the toggles.

  • joe_hannes_col Profile Picture
    1,843 Super User 2024 Season 1 on at

    Thanks for sharing the additional information, @sironman.

    If I see this correctly, your form is set to edit mode. The controls will only get updated once the form is submitted.

    Could you try inserting a form in view mode with the same data source and item property, and the datacard for the toggle controls? The date of the form in view mode should be updated when the data source is refreshed.

  • sironman Profile Picture
    19 on at

    I just tried changing the form to View Mode, but even if it updates, it won't work for me. There are hyperlinks to the courses on the form and there are some other courses in which I need users to type into text fields, so as far as I know, I need the form in edit mode. I wonder if there is a workaround to this issue. I'll have to do some thinking.

  • joe_hannes_col Profile Picture
    1,843 Super User 2024 Season 1 on at

    So assuming having the form in View mode would solve your problem: Why not have two forms on your screen, one in View mode, one in Edit mode? You could only include the "informational" controls on the View form, and the interactive ones on the Edit form.

    The alternative would be to include toggles outside of your form and use the lookup formula for your toggles' default values to display the current values from your data source.

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard