cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Partisan
Post Partisan

Time button not working

I just need a bit of assistance for one of the clock buttons I'm working on, I have it working for the clock in button but for the clock out button where I'm also using the same formulas, it doesn't seem to work at all. I'm using separate variables for both clock in and clock out button but the same formula still applies but only the clock in button works except for the clock out. 

 

Below is the formulas and functions used for each buttons.

clock In/Out - OnSelect

Clock In
Set(VARCurrentDateTime,Now())

Clock Out
Set(VARCurrentDateTime2,Now())

DateTime Field - DateValue

Clock In
If(Form1.Mode = FormMode.New,VARCurrentDateTime,Parent.Default)

Clock Out
If(Form1.Mode = FormMode.New,VARCurrentDateTime2,Parent.Default)

Hour and Minute value

Clock In
If(Form1.Mode = FormMode.New,Text(Hour(VARCurrentDateTime),"[$-en-GB]00"),Text(Hour(Parent.Default),"[$-en-GB]00"))

If(Form1.Mode = FormMode.New,Text(Minute(VARCurrentDateTime),"[$-en-GB]00"),Text(Minute(Parent.Default),"[$-en-GB]00"))

Clock Out
If(Form1.Mode = FormMode.New,Text(Hour(VARCurrentDateTime2),"[$-en-GB]00"),Text(Hour(Parent.Default),"[$-en-GB]00"))

If(Form1.Mode = FormMode.New,Text(Minute(VARCurrentDateTime2),"[$-en-GB]00"),Text(Minute(Parent.Default),"[$-en-GB]00"))

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @SandraAkujobi ,

Could you please share a screenshot about your issue?

Do you mean that when you click the "Check Out" button, the "Clock Out" (date time field) data card could not be populated with proper value?

 

For "Check In" field or "Check Out" field in your Edit form, the Date time field data card value would be populated with current time through the variable (VARCurrentDateTime or VARCurrentDateTime2) only when your Edit form is in New Mode. But when your Edit form is in Edit mode, the Date time field data card value would be populated with stored value from your data source itself.

 

I assume that when you create a new entry, when you press the 'Check In' button, the Check In date time field data card value would be populated with current time, right? And when you edit an existing record in your SP List, and press the 'Check Out' button, the Check Out field data card should also be populated with current time, is it true?

 

As an fixed solution, please try the following workaround:

Set the DefaultDate property of the 'Check Out' DatePicker control to following:

If(
   !IsBlank(VARCurrentDateTime2),
   VARCurrentDateTime2,
   Parent.Default
)

Set the Default property of the 'Check Out' Hour Dropdown box to following:

If(
   !IsBlank(VARCurrentDateTime2),
   Text(Hour(VARCurrentDateTime2),"[$-en-GB]00"),
   Text(Hour(Parent.Default),"[$-en-GB]00")
)

Set the Default property of the 'Check Out' Minute Dropdown box to following:

If(
    !IsBlank(VARCurrentDateTime2),
    Text(Minute(VARCurrentDateTime2),"[$-en-GB]00"),
    Text(Minute(Parent.Default),"[$-en-GB]00")
)

 

Set the OnSuccess property of the Edit form (Form1) to following:

Set(VARCurrentDateTime, Blank());
Set(VARCurrentDateTime2, Blank());
Back()

 

Please try above solution, then check if the issue is solved.

 

Regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support
Community Support

Hi @SandraAkujobi ,

Could you please share a screenshot about your issue?

Do you mean that when you click the "Check Out" button, the "Clock Out" (date time field) data card could not be populated with proper value?

 

For "Check In" field or "Check Out" field in your Edit form, the Date time field data card value would be populated with current time through the variable (VARCurrentDateTime or VARCurrentDateTime2) only when your Edit form is in New Mode. But when your Edit form is in Edit mode, the Date time field data card value would be populated with stored value from your data source itself.

 

I assume that when you create a new entry, when you press the 'Check In' button, the Check In date time field data card value would be populated with current time, right? And when you edit an existing record in your SP List, and press the 'Check Out' button, the Check Out field data card should also be populated with current time, is it true?

 

As an fixed solution, please try the following workaround:

Set the DefaultDate property of the 'Check Out' DatePicker control to following:

If(
   !IsBlank(VARCurrentDateTime2),
   VARCurrentDateTime2,
   Parent.Default
)

Set the Default property of the 'Check Out' Hour Dropdown box to following:

If(
   !IsBlank(VARCurrentDateTime2),
   Text(Hour(VARCurrentDateTime2),"[$-en-GB]00"),
   Text(Hour(Parent.Default),"[$-en-GB]00")
)

Set the Default property of the 'Check Out' Minute Dropdown box to following:

If(
    !IsBlank(VARCurrentDateTime2),
    Text(Minute(VARCurrentDateTime2),"[$-en-GB]00"),
    Text(Minute(Parent.Default),"[$-en-GB]00")
)

 

Set the OnSuccess property of the Edit form (Form1) to following:

Set(VARCurrentDateTime, Blank());
Set(VARCurrentDateTime2, Blank());
Back()

 

Please try above solution, then check if the issue is solved.

 

Regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (54,751)