{"id":937,"date":"2018-12-06T06:46:33","date_gmt":"2018-12-06T06:46:33","guid":{"rendered":"https:\/\/www.tatvasoft.com.au\/blog\/?p=937"},"modified":"2022-03-17T07:43:21","modified_gmt":"2022-03-17T07:43:21","slug":"implementing-offline-capability-in-powerapps-with-sharepoint-part-2","status":"publish","type":"post","link":"https:\/\/www.tatvasoft.com.au\/blog\/implementing-offline-capability-in-powerapps-with-sharepoint-part-2\/","title":{"rendered":"Implementing Offline Capability in PowerApps with SharePoint- Part 2"},"content":{"rendered":"<p>This blog is a continuation in the series of blogs for implementing offline capability in PowerApps with SharePoint.<\/p>\n<p><a href=\"https:\/\/www.tatvasoft.com.au\/blog\/implementing-offline-capability-in-powerapps-with-sharepoint-part-1\/\">In the first part<\/a>, we streamlined the process to enable and configure offline capabilities in your applications.<span id=\"more-1326\"><\/span><\/p>\n<p>Here, we\u2019ll determine the behavior of an offline app. We\u2019ll look at how to cache data locally and display the cached data when the app becomes offline. We\u2019ll develop a system to handle offline addition, updaAdd a new record in a mobile device when the internet connection is not available.ting, and deletion of data and build a conflict resolution screen, wherein <a href=\"https:\/\/www.tatvasoft.com.au\/technologies\/sharepoint-development\/\">SharePoint programmer<\/a> can retain the offline record or revert to the most recent version of the record.<\/p>\n<p>If you require your app to be fully functional offline, it is a must to handle offline record deletion and edit. Apart from that, in cases where you lose internet connectivity for an extended period of time, other users may update same records which you have deleted.<\/p>\n<p>We can build a Conflict Resolution screen to prevent users from overwriting their changes and avoid data conflicts. In a case where data conflicts exist, the user can retain or discard offline changes using this screen.<\/p>\n<h2>Capture New Books or Update an Existing Record<\/h2>\n<p>There are numerous changes we need to make to save icon of the edit screen in order to handle offline data edits and data entries.<\/p>\n<p>The approach is to override the use of <strong>SubmitForm<\/strong> function to save the book in the <strong>BooksCollection<\/strong> collection because we need to allocate a temporary id to enable us to edit or delete records created in offline mode.<\/p>\n<p>Override code of the <strong>OnSelect<\/strong> property of <strong>Save<\/strong> icon containing <strong>SubmitForm<\/strong> function inside the edit screen.<\/p>\n<p>Below are the high-level steps to accomplish this<\/p>\n<ol>\n<li>Assign values based on whether the user is adding or editing a record.<\/li>\n<li>Retrieve form values entered by user and access form values using Updates property.<\/li>\n<li>Load the next available temporary id.<\/li>\n<li>If the connection is available, update \u201cBest Books\u201d list and store returned record inside it. \u201cBooksRecord\u201d collection using Patch operation. Refer link to know more about Patch function: https:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/canvas-apps\/functions\/function-patch<\/li>\n<li>If the connection is not available, patch the record inside \u201cBooksRecordOffline\u201d collection.<\/li>\n<li>Uniquely identify records that are created offline by setting id which is generated earlier.<\/li>\n<li>Include \u201cModified\u201d field for offline data updates to check for conflicts during the synchronization process.<\/li>\n<li>Sync \u201cBooksCollection\u201d collection.<\/li>\n<\/ol>\n<ul>\n<li>If connection is available, patch \u201cBooksRecord\u201d to \u201cBooksCollection\u201d collection.<\/li>\n<li>If the connection is not available, patch \u201cBooksRecordOffline\u201d collection.<\/li>\n<\/ul>\n<h3>Add a Record Offline<\/h3>\n<p>Carry out the demo given below to add a record in offline mode in a mobile device after configuring the whole app.<\/p>\n<ul>\n<li>Add a new record in a mobile device when the internet connection is not available.<img loading=\"lazy\" class=\"aligncenter wp-image-1327 \" style=\"max-width: 100%; height: auto;\" title=\"Add a new record\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Add-a-new-record.png\" sizes=\"(max-width: 356px) 100vw, 356px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Add-a-new-record.png 545w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Add-a-new-record-300x41.png 300w\" alt=\"Add a new record\" width=\"356\" height=\"49\" \/><\/li>\n<li>Add a \u201cBook Name\u201d and \u201cAuthor\u201d and click Submit icon. Close the app.<img loading=\"lazy\" class=\"aligncenter wp-image-1331 \" style=\"max-width: 100%; height: auto;\" title=\"Add a book name\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Add-a-book-name-1.png\" sizes=\"(max-width: 286px) 100vw, 286px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Add-a-book-name-1.png 530w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Add-a-book-name-1-300x178.png 300w\" alt=\"Add a book name\" width=\"286\" height=\"169\" \/><\/li>\n<li>Open the app when the internet connection is available and click on sync icon to navigate to SyncScreen.<img loading=\"lazy\" class=\"wp-image-1332 aligncenter\" style=\"max-width: 100%; height: auto;\" title=\"Click on sync icon\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-on-sync-icon.png\" sizes=\"(max-width: 344px) 100vw, 344px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-on-sync-icon.png 537w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-on-sync-icon-300x36.png 300w\" alt=\"Click on sync icon\" width=\"344\" height=\"41\" \/><\/li>\n<li>You can view the record you created in offline mode on the sync screen. Click on the Synchronize button to add the record to the database.<img loading=\"lazy\" class=\"aligncenter wp-image-1333 \" style=\"max-width: 100%; height: auto;\" title=\"Click on the Synchronize button\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-on-the-Synchronize-button.png\" sizes=\"(max-width: 271px) 100vw, 271px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-on-the-Synchronize-button.png 374w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-on-the-Synchronize-button-170x300.png 170w\" alt=\"Click on the Synchronize button\" width=\"271\" height=\"477\" \/><\/li>\n<li>Navigate to the browser screen by clicking Back button and click on Refresh icon to view the newly added record.<img loading=\"lazy\" class=\"aligncenter wp-image-1334 \" style=\"max-width: 100%; height: auto;\" title=\"Refresh icon\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Refresh-icon.png\" sizes=\"(max-width: 272px) 100vw, 272px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Refresh-icon.png 546w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Refresh-icon-300x220.png 300w\" alt=\"Refresh icon\" width=\"272\" height=\"200\" \/><\/li>\n<\/ul>\n<h3>Update a Record Offline<\/h3>\n<p>Carry out the demo given below to update a record in offline mode in a mobile device after configuring the whole app.<\/p>\n<ul>\n<li>Navigate to details screen of a particular record to update its properties.<img loading=\"lazy\" class=\"aligncenter wp-image-1335 \" style=\"max-width: 100%; height: auto;\" title=\"Navigate to details\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Navigate-to-details.png\" sizes=\"(max-width: 290px) 100vw, 290px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Navigate-to-details.png 543w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Navigate-to-details-300x222.png 300w\" alt=\"Navigate to details\" width=\"290\" height=\"215\" \/><\/li>\n<li>Edit a record in offline mode from a mobile device.<img loading=\"lazy\" class=\"aligncenter wp-image-1336 \" style=\"max-width: 100%; height: auto;\" title=\"Edit a record in offline mode\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Edit-a-record-in-offline-mode.png\" sizes=\"(max-width: 341px) 100vw, 341px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Edit-a-record-in-offline-mode.png 544w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Edit-a-record-in-offline-mode-300x138.png 300w\" alt=\"Edit a record in offline mode\" width=\"341\" height=\"157\" \/><\/li>\n<li>Edit a field associated with the record and click on the Submit button. Close the app.<img loading=\"lazy\" class=\"aligncenter wp-image-1337 \" style=\"max-width: 100%; height: auto;\" title=\"Edit a field associated\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Edit-a-field-associated.png\" sizes=\"(max-width: 279px) 100vw, 279px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Edit-a-field-associated.png 530w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Edit-a-field-associated-300x177.png 300w\" alt=\"Edit a field associated\" width=\"279\" height=\"165\" \/><\/li>\n<li>Once the internet connection is available, open the app and click on Sync icon to navigate to sync screen.<img loading=\"lazy\" class=\"aligncenter wp-image-1338 \" style=\"max-width: 100%; height: auto;\" title=\"Click on Sync icon to navigate\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-on-Sync-icon-to-navigate.png\" sizes=\"(max-width: 302px) 100vw, 302px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-on-Sync-icon-to-navigate.png 537w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-on-Sync-icon-to-navigate-300x36.png 300w\" alt=\"Click on Sync icon to navigate\" width=\"302\" height=\"36\" \/><\/li>\n<li>You can view record updates on the sync screen. Click Synchronize to apply the changes.<img loading=\"lazy\" class=\"aligncenter wp-image-1339 \" style=\"max-width: 100%; height: auto;\" title=\"Click Synchronize to apply \" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-Synchronize-to-apply.png\" sizes=\"(max-width: 271px) 100vw, 271px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-Synchronize-to-apply.png 429w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-Synchronize-to-apply-167x300.png 167w\" alt=\"\" width=\"271\" height=\"487\" \/><\/li>\n<li>Click Back icon and refresh the browse screen to view your changes.<img loading=\"lazy\" class=\"aligncenter wp-image-1340 \" style=\"max-width: 100%; height: auto;\" title=\"Refresh the browse screen to view\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Refresh-the-browse-screen-to-view.png\" sizes=\"(max-width: 286px) 100vw, 286px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Refresh-the-browse-screen-to-view.png 544w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Refresh-the-browse-screen-to-view-300x219.png 300w\" alt=\"Refresh the browse screen to view\" width=\"286\" height=\"209\" \/><\/li>\n<\/ul>\n<h3>Handling Offline Deletions<\/h3>\n<p>An app should handle offline deletion of data for it to meet all the functional requirements. The details screen provides a delete icon.<\/p>\n<p>The most common way to delete an item from a local collection is to remove an item by a unique identifier.<\/p>\n<p>We need to add code to the <strong>OnSelect<\/strong> rule of <strong>Delete<\/strong> icon on the <strong>details screen<\/strong>.<\/p>\n<p>Below are the high-level steps to accomplish this:<\/p>\n<ul>\n<li>Remove record from local <strong>BooksCollection<\/strong>.<\/li>\n<li>Check whether the internet connection is available or not.<\/li>\n<li>If the connection is available, remove the record from \u201cBest Books\u201d list<\/li>\n<li>If the internet connection is not available, collect data in <strong>BooksChanges<\/strong> collection which keeps track of offline changes.<\/li>\n<li>Save data to offline file to retain an offline modifications.<\/li>\n<\/ul>\n<p>Carry out the demo given below to delete record in offline mode in a mobile device after configuring the whole app.<\/p>\n<ul>\n<li>Navigate to details screen for a particular record.<img loading=\"lazy\" class=\"aligncenter wp-image-1341 \" style=\"max-width: 100%; height: auto;\" title=\"Navigate to details screen\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Navigate-to-details-screen.png\" sizes=\"(max-width: 311px) 100vw, 311px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Navigate-to-details-screen.png 546w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Navigate-to-details-screen-300x147.png 300w\" alt=\"Navigate to details screen\" width=\"311\" height=\"152\" \/><\/li>\n<li>Delete a record in offline mode from a mobile device.<img loading=\"lazy\" class=\"wp-image-1342 aligncenter\" style=\"max-width: 100%; height: auto;\" title=\"Delete a record in offline mode\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Delete-a-record-in-offline-mode.png\" sizes=\"(max-width: 321px) 100vw, 321px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Delete-a-record-in-offline-mode.png 544w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Delete-a-record-in-offline-mode-300x137.png 300w\" alt=\"Delete a record in offline mode\" width=\"321\" height=\"147\" \/><\/li>\n<li>Close the app and re-open \u201cBest Books\u201d app when the internet connection is available.<\/li>\n<li>Click sync icon to navigate to SyncScreen.<img loading=\"lazy\" class=\"aligncenter wp-image-1343 \" style=\"max-width: 100%; height: auto;\" title=\"Navigate to SyncScreen\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Navigate-to-SyncScreen.png\" sizes=\"(max-width: 285px) 100vw, 285px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Navigate-to-SyncScreen.png 537w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Navigate-to-SyncScreen-300x36.png 300w\" alt=\"Navigate to SyncScreen\" width=\"285\" height=\"34\" \/><\/li>\n<li>You can view the record deleted in offline mode.<img loading=\"lazy\" class=\"aligncenter wp-image-1344 \" style=\"max-width: 100%; height: auto;\" title=\"Record deleted in offline mode\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Record-deleted-in-offline-mode.png\" sizes=\"(max-width: 226px) 100vw, 226px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Record-deleted-in-offline-mode.png 366w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Record-deleted-in-offline-mode-167x300.png 167w\" alt=\"Record deleted in offline mode\" width=\"226\" height=\"407\" \/><\/li>\n<li>Click the Synchronize button in order to process offline deleted record, click the Back button and then refresh the browser screen. You can see that the record is removed from the view. You can also check by navigating to the SharePoint list to check whether the record is deleted.<\/li>\n<\/ul>\n<h3>Conflict Resolution<\/h3>\n<p>We can create a screen to provide a means for users to resolve data conflicts if the synchronization process faces records in a conflicted state.<\/p>\n<ul>\n<li>Create a screen named \u201cConflictResolutionScreen\u201d of type Scrollable. Delete the canvas inside the screen. Rename the label text at the top to \u201cResolve conflicts\u2019. Remove \u201cNext\u201d arrow as it is not required.<\/li>\n<li>Add a gallery control of type Vertical inside the screen and adjust size of the control. Name the control \u201cBooksConflict\u201d and set its Item property to <strong>BooksChangesConflict.<\/strong><img loading=\"lazy\" class=\"aligncenter wp-image-1345 \" style=\"max-width: 100%; height: auto;\" title=\"Set its Item property\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Set-its-Item-property.png\" sizes=\"(max-width: 247px) 100vw, 247px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Set-its-Item-property.png 310w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Set-its-Item-property-291x300.png 291w\" alt=\"Set its Item property\" width=\"247\" height=\"255\" \/><\/li>\n<li>Show the desired fields using the syntax ThisItem.OfflineRecord.&lt;Fieldname&gt;<img loading=\"lazy\" class=\"wp-image-1347 aligncenter\" style=\"max-width: 100%; height: auto;\" title=\"Show the desired fields\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Show-the-desired-fields-1024x289.png\" sizes=\"(max-width: 311px) 100vw, 311px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Show-the-desired-fields-1024x289.png 1024w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Show-the-desired-fields-300x85.png 300w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Show-the-desired-fields-768x217.png 768w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Show-the-desired-fields.png 1152w\" alt=\"Show the desired fields\" width=\"311\" height=\"88\" \/><\/li>\n<li>Similarly set Text properties of other two fields \u201cBook Name\u201d and \u201cAuthor\u201d<\/li>\n<li>Add two button controls named \u201cRetain\u201d and \u201cDiscard\u201d to item of the gallery control to enable users to keep or discard offline changes. Add a \u201cBack\u201d button inside the screen<img loading=\"lazy\" class=\"aligncenter wp-image-1348 \" style=\"max-width: 100%; height: auto;\" title=\"Add two button controls\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Add-two-button-controls.png\" sizes=\"(max-width: 317px) 100vw, 317px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Add-two-button-controls.png 380w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Add-two-button-controls-300x152.png 300w\" alt=\"Add two button controls\" width=\"317\" height=\"160\" \/><\/li>\n<li>Two button controls \u201cRetain\u201d and \u201cDiscard\u201d are displayed for each conflicted item on the \u201cConflictResolutionScreen\u201d screen.<\/li>\n<li>Add formula on the OnSelect property of the discard button to remove offline version of record to keep record server version.<img loading=\"lazy\" class=\"alignnone size-full wp-image-1352\" style=\"max-width: 100%; height: auto;\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Sync-icon-to-navigate-to-sync-screen.png\" sizes=\"(max-width: 537px) 100vw, 537px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Sync-icon-to-navigate-to-sync-screen.png 537w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Sync-icon-to-navigate-to-sync-screen-300x36.png 300w\" alt=\"Sync icon to navigate to sync screen\" width=\"537\" height=\"64\" \/><\/li>\n<li>Patch the offline record to SharePoint list to keep offline version of record. For that, add code to OnSelect action of retain button on conflict resolution screen.<\/li>\n<li>Add formula to the OnSelect action of the back button on conflicts resolution screen to navigate on Sync screen.<\/li>\n<\/ul>\n<h3>Walkthrough for Resolving Conflicts<\/h3>\n<p>Carry out the demo given below to retain\/discard conflicting records processed in offline mode in a mobile device after configuring the whole app.<\/p>\n<ul>\n<li>Navigate to details screen for a particular record and edit a record in offline mode from a mobile device.<img loading=\"lazy\" class=\"aligncenter wp-image-1349 \" style=\"max-width: 100%; height: auto;\" title=\"Edit a record in offline mode\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Edit-a-record-in-offline-mode-1.png\" sizes=\"(max-width: 337px) 100vw, 337px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Edit-a-record-in-offline-mode-1.png 544w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Edit-a-record-in-offline-mode-1-300x138.png 300w\" alt=\"Edit a record in offline mode\" width=\"337\" height=\"155\" \/><\/li>\n<li>Edit a field associated with the record and click on Submit button.<img loading=\"lazy\" class=\"aligncenter wp-image-1350 \" style=\"max-width: 100%; height: auto;\" title=\"Edit a field\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Edit-a-field.png\" sizes=\"(max-width: 285px) 100vw, 285px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Edit-a-field.png 528w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Edit-a-field-300x175.png 300w\" alt=\"Edit a field\" width=\"285\" height=\"166\" \/><\/li>\n<li>Again delete the record for which you made update earlier. Close the app.<img loading=\"lazy\" class=\"aligncenter wp-image-1351 \" style=\"max-width: 100%; height: auto;\" title=\"Delete the record\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Delete-the-record.png\" sizes=\"(max-width: 341px) 100vw, 341px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Delete-the-record.png 524w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Delete-the-record-300x137.png 300w\" alt=\"Delete the record\" width=\"341\" height=\"156\" \/><\/li>\n<li>Once the internet connection is available, click on Sync icon to navigate to sync screen.<img loading=\"lazy\" class=\"aligncenter wp-image-1352\" style=\"max-width: 100%; height: auto;\" title=\"Sync icon to navigate to sync screen\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Sync-icon-to-navigate-to-sync-screen.png\" sizes=\"(max-width: 285px) 100vw, 285px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Sync-icon-to-navigate-to-sync-screen.png 537w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Sync-icon-to-navigate-to-sync-screen-300x36.png 300w\" alt=\"Sync icon to navigate to sync screen\" width=\"285\" height=\"34\" \/><\/li>\n<li>You can view conflicting records on the sync screen. Click on \u201cSynchronize\u201d button.<img loading=\"lazy\" class=\"aligncenter wp-image-1353 \" style=\"max-width: 100%; height: auto;\" title=\"Click on \u201cSynchronize\u201d button\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-on-\u201cSynchronize\u201d-button.png\" sizes=\"(max-width: 205px) 100vw, 205px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-on-\u201cSynchronize\u201d-button.png 366w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Click-on-\u201cSynchronize\u201d-button-167x300.png 167w\" alt=\"Click on \u201cSynchronize\u201d button\" width=\"205\" height=\"369\" \/><\/li>\n<li>Once you click on \u201cSynchronize\u201d button, \u201cConflicts\u201d button is enabled and the conflicted records will be moved to conflict resolution screen. Click \u201cConflicts\u201d button to resolve the conflicts.<\/li>\n<\/ul>\n<p><em><strong>Note:<\/strong><\/em> In the case of non-conflicting offline records, they will be processed into SharePoint list.<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter wp-image-1354 \" style=\"max-width: 100%; height: auto;\" title=\"Sync Offline Changes\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Sync-Offline-Changes.png\" sizes=\"(max-width: 222px) 100vw, 222px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Sync-Offline-Changes.png 368w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Sync-Offline-Changes-168x300.png 168w\" alt=\"Sync Offline Changes\" width=\"222\" height=\"398\" \/><\/p>\n<ul>\n<li>On the conflict resolution screen, choose whether to discard or retain the changes for conflicting records.<img loading=\"lazy\" class=\"aligncenter wp-image-1355 \" style=\"max-width: 100%; height: auto;\" title=\"Conflict resolution screen\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Conflict-resolution-screen.png\" sizes=\"(max-width: 253px) 100vw, 253px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Conflict-resolution-screen.png 529w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Conflict-resolution-screen-300x149.png 300w\" alt=\"Conflict resolution screen\" width=\"253\" height=\"125\" \/><\/li>\n<li>If you click \u201cRetain\u201d button and select Refresh icon on the browser screen, it will keep the updates as shown below else if you click \u201cDiscard\u201d, it will discard the changes.<img loading=\"lazy\" class=\"aligncenter wp-image-1356 \" style=\"max-width: 100%; height: auto;\" title=\"Click Retain button\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/click-\u201cRetain\u201d-button.png\" sizes=\"(max-width: 276px) 100vw, 276px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/click-\u201cRetain\u201d-button.png 532w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/click-\u201cRetain\u201d-button-300x296.png 300w\" alt=\"Click Retain button\" width=\"276\" height=\"273\" \/><\/li>\n<\/ul>\n<h3>Save and Publish your App<\/h3>\n<ul>\n<li>Once you are done developing offline-capable PowerApp with SharePoint, open File menu and then click Save.<img loading=\"lazy\" class=\"aligncenter wp-image-1357 \" style=\"max-width: 100%; height: auto;\" title=\"Save your App\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Save-your-App.png\" alt=\"Save your App\" width=\"196\" height=\"184\" \/><\/li>\n<li>Finally, Publish your app.<img loading=\"lazy\" class=\"aligncenter wp-image-1358 size-full\" style=\"max-width: 100%; height: auto;\" title=\"Publish your app\" src=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Publish-your-app.png\" sizes=\"(max-width: 332px) 100vw, 332px\" srcset=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Publish-your-app.png 332w, https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Publish-your-app-300x270.png 300w\" alt=\"Publish your app\" width=\"332\" height=\"299\" \/><\/li>\n<\/ul>\n<p>Once published, you can view your PowerApp and work with your SharePoint Online list from your phone.<\/p>\n<p>We are done building PowerApp with basic offline capabilities with SharePoint Online list. Your user can now view books cached earlier and can even create, update and delete books without internet connection, and to sync later when online. Ensure that the user has to open \u201cBest Books\u201d app at least once on the mobile device, so that \u201cBest Books\u201d SharePoint list is cached.<\/p>\n<h2>Conclusion<\/h2>\n<p>Building offline capable apps can make SharePoint development even more engaging for mobile users, especially when SharePoint developers are traveling to remote places with spotty internet connection availability. This series of blogs guided through the steps to build capabilities in your app that work offline. Once an app becomes offline, the browser screen shows data that was cached earlier when app was online.<\/p>\n<p>In case of offline data updates, we saw how to save changes to local file. Once the app retains internet connection, we can patch offline changes to SharePoint list.<\/p>\n<p>We also had a look at how to handle data conflicts by examining last modified date of the record. We processed conflicting record to a collection, which allows users to choose whether to keep or discard conflicting offline changes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog is a continuation in the series of blogs for implementing offline capability in PowerApps with SharePoint. In the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1904,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[29],"tags":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Offline Capability of PowerApps with SharePoint - Part 2<\/title>\n<meta name=\"description\" content=\"In this post we will determine the behaviour of an offline app. We can retain the offline record and revert to most recent record version.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.tatvasoft.com.au\/blog\/implementing-offline-capability-in-powerapps-with-sharepoint-part-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Offline Capability of PowerApps with SharePoint - Part 2\" \/>\n<meta property=\"og:description\" content=\"In this post we will determine the behaviour of an offline app. We can retain the offline record and revert to most recent record version.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tatvasoft.com.au\/blog\/implementing-offline-capability-in-powerapps-with-sharepoint-part-2\/\" \/>\n<meta property=\"og:site_name\" content=\"TatvaSoft AU Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-12-06T06:46:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-03-17T07:43:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Offline-Capability-in-PowerApps-2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"375\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"6 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.tatvasoft.com.au\/blog\/#website\",\"url\":\"https:\/\/www.tatvasoft.com.au\/blog\/\",\"name\":\"TatvaSoft AU Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.tatvasoft.com.au\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.tatvasoft.com.au\/blog\/implementing-offline-capability-in-powerapps-with-sharepoint-part-2\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.tatvasoft.com.au\/blog\/wp-content\/uploads\/2018\/12\/Offline-Capability-in-PowerApps-2.jpg\",\"width\":750,\"height\":375,\"caption\":\"Offline Capability of PowerApps with SharePoint - Part 2\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tatvasoft.com.au\/blog\/implementing-offline-capability-in-powerapps-with-sharepoint-part-2\/#webpage\",\"url\":\"https:\/\/www.tatvasoft.com.au\/blog\/implementing-offline-capability-in-powerapps-with-sharepoint-part-2\/\",\"name\":\"Offline Capability of PowerApps with SharePoint - Part 2\",\"isPartOf\":{\"@id\":\"https:\/\/www.tatvasoft.com.au\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.tatvasoft.com.au\/blog\/implementing-offline-capability-in-powerapps-with-sharepoint-part-2\/#primaryimage\"},\"datePublished\":\"2018-12-06T06:46:33+00:00\",\"dateModified\":\"2022-03-17T07:43:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.tatvasoft.com.au\/blog\/#\/schema\/person\/99be98dec950f3b1cdc014df166dd95c\"},\"description\":\"In this post we will determine the behaviour of an offline app. We can retain the offline record and revert to most recent record version.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.tatvasoft.com.au\/blog\/implementing-offline-capability-in-powerapps-with-sharepoint-part-2\/\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.tatvasoft.com.au\/blog\/#\/schema\/person\/99be98dec950f3b1cdc014df166dd95c\",\"name\":\"tatvasoftadmin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.tatvasoft.com.au\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1ef69a3ae4a620ca0f649d8228bece0b?s=96&d=mm&r=g\",\"caption\":\"tatvasoftadmin\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.tatvasoft.com.au\/blog\/wp-json\/wp\/v2\/posts\/937"}],"collection":[{"href":"https:\/\/www.tatvasoft.com.au\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tatvasoft.com.au\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tatvasoft.com.au\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tatvasoft.com.au\/blog\/wp-json\/wp\/v2\/comments?post=937"}],"version-history":[{"count":19,"href":"https:\/\/www.tatvasoft.com.au\/blog\/wp-json\/wp\/v2\/posts\/937\/revisions"}],"predecessor-version":[{"id":1984,"href":"https:\/\/www.tatvasoft.com.au\/blog\/wp-json\/wp\/v2\/posts\/937\/revisions\/1984"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tatvasoft.com.au\/blog\/wp-json\/wp\/v2\/media\/1904"}],"wp:attachment":[{"href":"https:\/\/www.tatvasoft.com.au\/blog\/wp-json\/wp\/v2\/media?parent=937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tatvasoft.com.au\/blog\/wp-json\/wp\/v2\/categories?post=937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tatvasoft.com.au\/blog\/wp-json\/wp\/v2\/tags?post=937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}