SOLVED

Check-in Check-out

%3CLINGO-SUB%20id%3D%22lingo-sub-2877944%22%20slang%3D%22en-US%22%3ECheck-in%20%26amp%3B%20Check-out%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2877944%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Community%2C%3C%2FP%3E%3CP%3EHave%20created%20a%20check-in%20and%20check-out%20app%20that%20works%20beautifully%20%22%3CSTRONG%3Eonly%3C%2FSTRONG%3E%22%20if%20the%20app%20stays%20open.%3C%2FP%3E%3CP%3EScenario%3A%26nbsp%3B%20Member%20checks%20in%20for%20work%2C%20i.e.%200800%2C%20closes%20app.%26nbsp%3B%20End%20of%20day%2C%20member%20opens%20app%20again%20and%20checks%20out%2C%201600.%26nbsp%3B%20Need%20to%20be%20able%20to%20call%20the%20record%20back%20when%20checking%20out.%3C%2FP%3E%3CP%3EAdditionally%2C%20the%20member%20works%20overtime%20that%20day%20and%20needs%20to%20access%20the%20same%20record%202%20more%20times.%26nbsp%3B%20At%20the%20end%20of%20the%20day%2C%20the%20entry%20should%20look%20like%20the%20below.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22chudson002_0-1635034653856.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F319492i10C7BE48B6EC6AD0%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22chudson002_0-1635034653856.png%22%20alt%3D%22chudson002_0-1635034653856.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EHave%204%20different%20buttons%20for%20each%20entry.%26nbsp%3B%20Cannot%20get%20the%20button%20to%20work%20upon%20opening%20the%20app%202nd%2C%203rd%20and%204th%20time.%26nbsp%3B%20Again%2C%20all%204%20entries%20work%20great%20as%20long%20as%20the%20app%20is%20%3CSTRONG%3Eopen.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EAny%20recommendations%3F%3C%2FP%3E%3CP%3EV%2FR%3C%2FP%3E%3CP%3Echudson002%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2877944%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerApps%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2878022%22%20slang%3D%22en-US%22%3ERe%3A%20Check-in%20Check-out%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2878022%22%20slang%3D%22en-US%22%3E%3CP%3EFigured%20it%20out!!!!!!!%3C%2FP%3E%3CP%3E%3CSTRONG%3EButton%3A%26nbsp%3B%20TWCheck-in%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ESet(%3CBR%20%2F%3ECurrentCheckedinRecord%2C%3CBR%20%2F%3EPatch(%3CBR%20%2F%3ECheckInOut%2C%3CBR%20%2F%3EDefaults(CheckInOut)%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3EEmployee%3A%20User().FullName%2C%3CBR%20%2F%3ETWin%3A%20Now()%2C%3CBR%20%2F%3EDivision%3A%20ddDiv.Selected%2C%3CBR%20%2F%3ERemarks%3A%20Remarks1.Text%3CBR%20%2F%3E%7D))%3B%26nbsp%3BReset(ddDiv)%3B%20Reset(Remarks1)%3B%3CBR%20%2F%3E%3CSTRONG%3EButton%3A%26nbsp%3B%20TWCheck-out%3CBR%20%2F%3E%3C%2FSTRONG%3EUpdateIf(CheckInOut%2C%20!IsBlank(TWin)%2C%20%7BTWout%3A%20Now()%7D)%3CBR%20%2F%3E%3CSTRONG%3EButton%3A%26nbsp%3B%20OTCheck-in%3CBR%20%2F%3E%3C%2FSTRONG%3EUpdateIf(CheckInOut%2C%20!IsBlank(TWin)%2C%20%7BOTin%3A%20Now()%7D)%3CSTRONG%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EButton%3A%26nbsp%3B%20OTCheck-out%3CBR%20%2F%3E%3C%2FSTRONG%3EUpdateIf(CheckInOut%2C%20!IsBlank(TWin)%2C%20%7BOTout%3A%20Now()%7D)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

Hello Community,

Have created a check-in and check-out app that works beautifully "only" if the app stays open.

Scenario:  Member checks in for work, i.e. 0800, closes app.  End of day, member opens app again and checks out, 1600.  Need to be able to call the record back when checking out.

Additionally, the member works overtime that day and needs to access the same record 2 more times.  At the end of the day, the entry should look like the below.  

chudson002_0-1635034653856.png

Have 4 different buttons for each entry.  Cannot get the button to work upon opening the app 2nd, 3rd and 4th time.  Again, all 4 entries work great as long as the app is open.

Any recommendations?

V/R

chudson002

1 Reply
best response confirmed by chudson002 (Contributor)
Solution

Figured it out!!!!!!!

Button:  TWCheck-in

Set(
CurrentCheckedinRecord,
Patch(
CheckInOut,
Defaults(CheckInOut),
{
Employee: User().FullName,
TWin: Now(),
Division: ddDiv.Selected,
Remarks: Remarks1.Text
})); Reset(ddDiv); Reset(Remarks1);
Button:  TWCheck-out
UpdateIf(CheckInOut, !IsBlank(TWin), {TWout: Now()})
Button:  OTCheck-in
UpdateIf(CheckInOut, !IsBlank(TWin), {OTin: Now()})

Button:  OTCheck-out
UpdateIf(CheckInOut, !IsBlank(TWin), {OTout: Now()})