Created
December 24, 2018 12:02
-
-
Save chrisobriensp/75f443f29f95d67b9bb970a38575396e to your computer and use it in GitHub Desktop.
PowerApps formula to save a record locally if device is offline, or submit it to datasource otherwise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| If( | |
| Connection.Connected, | |
| Patch( | |
| 'My SharePoint list', | |
| Defaults('My SharePoint list'), | |
| { | |
| Title: Concatenate( | |
| "Leave Request - ", | |
| User().Email, | |
| " - ", | |
| Text( | |
| Now(), | |
| "[$-en-GB]dd/mm/yyyy hh:mm" | |
| ) | |
| ), | |
| Requestor: currentUser, | |
| RequestorStaffNumber: txtRequestorStaffNumber.Text, | |
| LeaveRequestType: LeaveType | |
| } | |
| ); | |
| Navigate( | |
| ConfirmationScreen, | |
| ScreenTransition.Fade | |
| ), | |
| ClearCollect( | |
| LocalRecord, | |
| { | |
| Title: Concatenate( | |
| "Leave Request - ", | |
| User().Email, | |
| " - ", | |
| Text( | |
| Now(), | |
| "[$-en-GB]dd/mm/yyyy hh:mm:ss" | |
| ) | |
| ), | |
| Requestor: currentUser, | |
| RequestorStaffNumber: txtRequestorStaffNumber.Text, | |
| LeaveRequestType: LeaveType | |
| } | |
| ); | |
| SaveData(LocalRecord, "LocalRecord"); | |
| Navigate( | |
| PendingScreen, | |
| ScreenTransition.Fade | |
| ) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment