cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SandraAkujobi
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
v-xida-msft
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
v-xida-msft
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
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

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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