I have a SharePoint page where employees record the start and stop times for each operation in a work order. I’m trying to create a user-friendly form in Power Apps to streamline this process. The form needs to be reopened multiple times to log times for different operations.
I’ve added a button that populates the current time when clicked, and each time entry is managed using variables. For example, the variable op1start is initialized as empty ("") in the OnVisible property of the screen (formscreen1) and updates with the current time when the button is clicked. The time fields use this formula:
If(MaskStop = "", Right(Left(Parent.Default, 5), 2), Text(Minute(Now()), "00")).
This works perfectly the first time the form is opened. However, after closing and reopening the form using the "NEW" button, the variables don’t reset. As a result, the time fields are prefilled with the last session's data instead of resetting to blank. I’ve tried resetting the variables using Set(Var, "") and using ResetForm(formscreen1) in the OnSave, OnNew, OnSuccess, and OnVisible properties, but nothing seems to resolve the issue.
Is there something about Power Apps forms that could be causing this behavior? How can I ensure the variables reset properly each time the form is reopened?