Here’s the complete solution for integrating lightning-record-edit-form with Screen Flows for mobile compatibility:
Understanding the Issue
The lightning-record-edit-form component handles its own save operation through Lightning Data Service (LDS), but Screen Flows don’t automatically capture these client-side updates. On desktop browsers, aggressive caching can make it appear that changes persist, but mobile apps refresh data more frequently, exposing the fact that the flow never actually saved the updates.
Solution: Proper Screen Flow and LWC Integration
Step 1: LWC Component with Event Handling
Modify your component to explicitly communicate with the flow:
import { LightningElement, api } from 'lwc';
export class ContactEditForm extends LightningElement {
@api recordId;
handleSuccess(event) {
const updatedFields = event.detail.fields;
const saveEvent = new CustomEvent('recordsaved', {
detail: { fields: updatedFields }
});
this.dispatchEvent(saveEvent);
}
}
Update template:
<lightning-record-edit-form
object-api-name="Contact"
record-id={recordId}
onsuccess={handleSuccess}>
<lightning-input-field field-name="Email"></lightning-input-field>
<lightning-button type="submit" label="Save"></lightning-button>
</lightning-record-edit-form>
Step 2: Flow Configuration
In Flow Builder:
- Add your LWC screen component
- Create output variables in the component configuration to capture the saved field values
- Add an Update Records element AFTER the screen
- Map the output variables to the Contact record fields
- This ensures the flow explicitly saves data, not just the LDS cache
Step 3: Object Permissions for Flows
Verify flow permissions:
- Go to Setup → Flows → your flow → Open
- Check “Run as System” vs “Run as User” context
- If running as User, verify the mobile user’s profile has Edit permission on Contact object
- Confirm field-level security allows editing the Email field
- Mobile apps enforce stricter permission checks than desktop
Alternative: Use Standard Flow Components
If your UI requirements aren’t complex, the standard Screen Flow record edit component is more reliable:
- Drag “Record Update” screen element onto canvas
- Select Contact object and fields to edit
- This component automatically handles mobile compatibility
- No custom code needed
- Maintains consistent behavior across all platforms
Why This Happens on Mobile
Mobile apps:
- Clear LDS cache more aggressively than desktop browsers
- Enforce stricter permission contexts
- Have different component lifecycle timing
- Don’t retain form state when navigating between screens
Desktop browsers cache more data locally, masking the fact that the flow never captured the updates. Mobile’s aggressive refresh exposes the integration gap.
Best Practice
For Screen Flows, always use explicit Update Records elements rather than relying on component-level saves. This ensures your automation works consistently regardless of device or browser caching behavior. The lightning-record-edit-form is excellent for standalone Lightning pages, but Screen Flows require explicit flow-to-component integration for reliable mobile operation.
This draft is based on general Salesforce knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.