Skip to content

Batch Update Federation IDs for Existing Users

This guide walks through how to batch-update Federation IDs for existing Salesforce users and create a simple audit log of updates.

🚨 Federation IDs must match the account ID format expected by our Google Workspace system.
New users are handled automatically, but existing users must be updated manually one time.


πŸ›  Overview

We created a Flow that: - Finds users missing a Federation ID, - Calculates a correct Federation ID based on their email, - Updates the User record, - Logs the change to a custom "Federation ID Update Log" object, - Allows easy review with a List View.


🧩 Step 1: Create the Federation ID Update Log Object

  1. Go to Setup β†’ Object Manager β†’ Create β†’ Custom Object.
  2. Fill out:
  3. Label: Federation ID Update Log
  4. Plural Label: Federation ID Update Logs
  5. Object Name: FederationIDUpdateLog
  6. Record Name: Auto-Number, format FID-{0000}
  7. Description: Log of Federation ID updates performed by automated flows.

  8. Check these options:

  9. βœ… Allow Reports
  10. ❌ Allow Activities (optional)
  11. βœ… Deployment Status: Deployed

  12. Save.


Add Custom Fields to the Object:

Field Label Field Type API Name Notes
User ID Text (255) UserId__c Salesforce User Id
Old Federation ID Text (255) OldFederationId__c Previous value
New Federation ID Text (255) NewFederationId__c New value
Email Email Email__c User’s email address
Updated At Date/Time UpdatedAt__c When the update happened

πŸ›  Step 2: Create the Batch Update Flow

  1. Go to Setup β†’ Flows β†’ New Flow.
  2. Type: Autolaunched Flow (no trigger).

Build the Flow:

1. Get Records: Find Users

  • Object: User
  • Conditions:
  • FederationId IS NULL
  • Profile.Name CONTAINS 'Experience'
  • Store: All Records

2. Loop Through Users

  • Add a Loop over the collection of users without Federation IDs.

Inside the Loop:


3. Create Assignment: Calculate New Federation ID

Create a Formula Resource:

LOWER(
  LEFT({!LoopedUser.Email}, FIND("@", {!LoopedUser.Email}) - 1)
  & "_"
  & LEFT(
      MID({!LoopedUser.Email}, FIND("@", {!LoopedUser.Email}) + 1, LEN({!LoopedUser.Email})),
      FIND(".", MID({!LoopedUser.Email}, FIND("@", {!LoopedUser.Email}) + 1, LEN({!LoopedUser.Email}))) - 1
    )
  & "@spokanemountaineers.org"
)

Assign this value to the FederationId field for the current User.


4. Create Record: Log the Update

  • Create a new record in Federation ID Update Log:
  • UserId__c = {!LoopedUser.Id}
  • OldFederationId__c = {!LoopedUser.FederationId}
  • NewFederationId__c = Calculated Federation ID
  • Email__c = {!LoopedUser.Email}
  • UpdatedAt__c = Now()

5. After Loop: Update Records

  • Use Update Records to update all modified users at once (bulk safe).

πŸ›  Step 3: Schedule the Flow

  1. In the Flow Settings, click Set a Schedule.
  2. Set it to run once immediately, or at a quiet time (overnight).

βœ… This will batch process all users missing Federation IDs.


πŸ”Ž Step 4: Add a List View for Log Visibility

  1. Go to App Launcher β†’ Search Federation ID Update Logs.
  2. If needed, Create a Tab in Setup β†’ Tabs β†’ New Custom Object Tab.
  3. On the "Federation ID Update Logs" screen:
  4. Click the Gear Icon βš™οΈ.
  5. Click New List View.
  6. Name it something like:
  7. All Logs
  8. or Recent Federation Updates
  9. Set visibility to yourself or your admin group.
  10. Customize Columns:
  11. Add: Email, Old Federation ID, New Federation ID, Updated At.
  12. Save.

βœ… Now you can monitor every Federation ID update that the batch flow processed.


πŸ“š Summary

  • Existing users are updated automatically using a Scheduled Flow.
  • Updates are logged into a custom object for easy auditing.
  • A List View provides real-time visibility into which users were updated.
  • This ensures that all Salesforce Federation IDs match our future Google Workspace accounts exactly.

✨ If you need to re-run the batch update in the future, simply re-schedule or manually trigger the Flow.