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

Super User II
Super User II

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

PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group


Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (20,650)