Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Update date picker values in an if statement

For context, I am building an app to record my shift hours during the week. I have made a dialog, to prompt if the start time and end time are match my usual schedule, based on the day of the week.


Screen 1: Dialog on BrowseScreen1


Screen Shot 2021-01-19 at 8.07.03 PM.png



So far I have programmed the Yes button to close the popup and go to EditScreen1(Form where I enter the data). I want an if statement inside the Yes button, to update the date and time values of EditScreen 1. Can someone advise how to accomplish this


For reference:

Screen 2: Edit Screen 1


 Screen Shot 2021-01-19 at 8.13.35 PM.png

Dual Super User
Dual Super User

Hi @m365newuser ,

My approach to your request:

set a global variable inside the OnSelect property of Yes button:


And set then the default property of controls (my guess is this are dropdown boxes)

IN hour  to:


IN minutes:


OUT hour:


OUT minutes:


Also set the default date of Out DatePicker to:



Hope it helps !

Hi @gabibalaban , I am new to Power Apps so please excuse any obvious things that I miss.


Can I ask how does your solution take into account the day of the week, my shift hours for each day varies. 

Secondly you mention to place (If(isNormalShift,"23",Hour(Now())) ) as default values, but I already have the default set to show the current date and time . I did this to save time selecting from the drop down and just straight away punching in the hours. Do I need to keep both or can your statement also display current time as an else statement 

@m365newuser ,

Well no .... Where do you keep your shift planning ? Is there a schema of your shift during the week ?

Regarding the second question formula  If(isNormalShift,"23",Hour(Now())) can be explained like this ...

If the user selected Yes button then show as default the "23", else show as default the now hour.

We have to get a logic off your shifts to create the schema.



Again sorry I am new to power apps, when you refer to schema, should that be like a Sharepoint list or a screen in the app with the schedule detail. 

Could you guide with the logic for the shifts?

Frequent Visitor

Hello @WarrenBelz , would appreciate your advice or feedback

Helpful resources

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (3,203)