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
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
Hi @m365newuser ,
My approach to your request:
set a global variable inside the OnSelect property of Yes button:
Set(isNormalShift,true)
And set then the default property of controls (my guess is this are dropdown boxes)
IN hour to:
If(isNormalShift,"23",Hour(Now()))
IN minutes:
If(isNormalShift,"00",Minute(Now())
OUT hour:
If(isNormalShift,"06",Hour(Now()))
OUT minutes:
If(isNormalShift,"00",Minute(Now())
Also set the default date of Out DatePicker to:
If(isNormalShift,DateAdd(Today(),1,Days)
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
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?
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
190 | |
63 | |
44 | |
34 | |
25 |
User | Count |
---|---|
243 | |
106 | |
89 | |
84 | |
64 |