The Axsy Mobile Flow Engine supports a custom Apex Action to sync records between the device and Salesforce Web.

The Element can be added to a Flow as with any other element. This element will sync new records, as well as any updates to records that are not currently synced to the device, and ensures that records are consistent locally and online.


NOTE: This element performs a delta sync. For more information, see this article: Delta Sync: Refreshing Data Using the "Sync Now" Button



Figure 1 - Sync Element in Flow Designer


Configuring the Sync Element

The Sync element has input values that can be configured:


Input Variable
Data Type
Description
MessageTextThe text to be displayed during the sync. This only shows if the sync is blocking. The default value for this is "Syncing...".
Non blockingBooleanIf set to true, sync will continue in the background. If false, the flow execution will be paused until sync is completed. The default value is false.


In order to successfully perform a Sync, the device needs to be online. This can be confirmed by using the Connectivity Check Element, followed by a decision element.



Example

In Figure 2, a new person account is created. Since Salesforce automatically created an associated contact as part of this process, a Sync element is used to ensure that the new contact is synced to the Axsy Mobile app. As outlined above, a Connectivity Check is performed first to ensure that the sync only occurs when online. This helps confirm that the sync is completed successfully, and allows the user to be notified if the sync does not occur.


Figure 2 - Example Flow with Sync following Connectivity Check