Offline sync fails for case creation in mobile apps, causing data loss on reconnection

Case creation on mobile app works offline, but records are not syncing back when connectivity returns. Field agents are creating support cases while on-site without network coverage, but when they return to coverage, the sync fails and data is lost.

The mobile app shows “Sync pending” status for offline-created cases, but after reconnection, the status changes to “Sync failed” with no detailed error message. We’ve lost approximately 30 cases over the past two weeks due to this issue.

I’m concerned about the offline sync logic handling of locally queued records, the local database queue management, and whether there’s a proper retry mechanism in place. The mobile app logs just show “Sync error - conflict detected” but don’t specify what conflict or how to resolve it. Has anyone dealt with offline case creation sync failures in Power Apps mobile?

That’s a good point. We do have some business rules that auto-populate fields based on the user’s role and location. These might not execute properly for offline-created records. Let me investigate the business rule execution order.

Check if you have duplicate detection rules enabled on the case entity. Duplicate detection can cause sync failures for offline records if the system thinks a similar case already exists. You might need to disable duplicate detection for mobile-created cases or adjust the duplicate detection rules to be less strict.

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:

  1. 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

  1. 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)
  1. 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:

  1. 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)
  1. 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
  1. 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:

  1. 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
  1. 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
  1. 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:

  1. 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
  1. 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
  1. 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:

  1. 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
  2. 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
  3. 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
  4. 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:

  1. Create case while offline
  2. Verify local storage
  3. Reconnect to network
  4. Monitor sync queue and detailed logs
  5. Confirm case appears in server with all fields populated
  6. 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.

The local database queue can get corrupted if the app crashes or is force-closed while sync is in progress. Try clearing the app cache and re-syncing from scratch. On iOS, uninstall and reinstall the Power Apps mobile app. On Android, clear app data from Settings → Apps → Power Apps → Storage → Clear Data. This will reset the local database queue.