I’ve resolved this exact data loss scenario multiple times in enterprise deployments. Your offline sync failures are caused by configuration gaps across all three areas you identified. Here’s the comprehensive solution:
Offline Sync Logic Configuration:
The core issue is that Power Apps mobile offline sync doesn’t handle all conflict scenarios gracefully by default. You need to configure explicit conflict resolution:
- Enable Detailed Sync Logging:
Navigate to Power Platform Admin Center → Environments → Your Environment → Settings → Features
Enable “Mobile offline detailed logging” - this will expose the actual sync errors
- Configure Offline Sync Filters:
In your mobile app settings, define offline filters that ensure all dependent data is available:
Offline Profile - Case Entity:
Include related: Account, Contact, Product
Filter: Modified in last 30 days OR Created by current user
Conflict Resolution: Client wins (for offline creates)
- Implement Pre-Sync Validation:
Add a client-side validation check before allowing offline case creation:
- Verify all required fields are populated
- Check that lookup references exist in offline cache
- Validate business rule requirements can be met offline
Local Database Queue Management:
The “Sync pending” to “Sync failed” transition indicates queue corruption or overflow. Implement proper queue management:
- Queue Size Limits:
Configure maximum offline queue size in mobile app settings:
- Maximum pending records: 1000
- Maximum retry attempts: 5
- Queue cleanup: Auto-delete failed records after 7 days (with backup)
- Queue Monitoring:
Implement a server-side flow that monitors sync queue health:
Power Automate Flow:
Trigger: Daily
Action: Query offline sync queue table
Condition: IF failed records > 10
Action: Alert admin + Generate recovery report
- Local Storage Optimization:
Offline cases consume local storage. Configure storage limits:
- Set offline data retention to 7 days for synced records
- Enable automatic cleanup of successfully synced records
- Implement storage quota monitoring (alert at 80% capacity)
Retry Mechanism Implementation:
The default retry logic is insufficient for field operations. Implement a robust retry strategy:
- Configure Exponential Backoff:
In offline profile settings:
Retry Configuration:
Attempt 1: Immediate (on reconnection)
Attempt 2: After 5 minutes
Attempt 3: After 15 minutes
Attempt 4: After 1 hour
Attempt 5: After 4 hours
Final: Move to manual resolution queue
- Implement Smart Conflict Resolution:
Create a plugin that handles offline sync conflicts:
- For new case creation: Always accept client version (offline created cases take precedence)
- For updates: Compare timestamps and use most recent
- For conflicts: Create duplicate case and flag for manual merge
- Add Manual Sync Recovery:
Implement a “Recover Failed Syncs” feature in your mobile app:
- Button visible when failed syncs exist
- OnSelect: Extract failed record data, validate, attempt re-sync
- If validation fails: Store as JSON attachment and create placeholder case
- Notify user of recovery status
Preventing Data Loss:
Critical safeguards to implement immediately:
- Automatic Backup:
Before sync attempts, backup offline data:
OnBeforeSync event:
Export pending cases to local JSON file
Store in app's backup folder
Retention: 30 days
- Sync Status Notifications:
Implement proactive user notifications:
- Warning when approaching offline storage limit
- Alert when sync has been pending > 24 hours
- Success confirmation with case numbers after successful sync
- Recovery Portal:
Create an admin portal for recovering lost cases:
- Query device sync logs from server
- Extract failed case data from backup JSON
- Manually create cases with original timestamp and creator
- Mark as “Recovered from offline sync failure”
Specific Fix for Your Current Issue:
The “conflict detected” error combined with data loss suggests your business rules are causing the sync to fail. Here’s the immediate fix:
-
Identify conflicting business rules:
- Go to Settings → Business Rules on Case entity
- Look for rules that run “On Create” with server-side execution
- These rules likely reference data not available during offline sync
-
Modify business rules for offline compatibility:
- Change execution context to “Client and Server”
- Add condition: “If Created Offline, skip rule”
- Or move rule execution to “After Sync Complete” trigger
-
Add offline-specific case creation flow:
- Create a separate flow triggered by “Case created via mobile offline”
- This flow runs the business logic after successful sync
- Populates fields that couldn’t be set offline
-
Recover lost cases:
- Check mobile app logs on affected devices (export via Power Apps Monitor)
- Extract case data from failed sync logs
- Manually recreate cases with correct timestamps and assign to original creators
After implementing these changes, test thoroughly:
- Create case while offline
- Verify local storage
- Reconnect to network
- Monitor sync queue and detailed logs
- Confirm case appears in server with all fields populated
- Test conflict scenarios (modify same case online while offline version pending)
This comprehensive approach will eliminate data loss and provide visibility into any future sync issues.