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¶
- Go to Setup β Object Manager β Create β Custom Object.
- Fill out:
- Label:
Federation ID Update Log
- Plural Label:
Federation ID Update Logs
- Object Name:
FederationIDUpdateLog
- Record Name: Auto-Number, format
FID-{0000}
-
Description:
Log of Federation ID updates performed by automated flows.
-
Check these options:
- β Allow Reports
- β Allow Activities (optional)
-
β Deployment Status: Deployed
-
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__c |
Userβs email address | ||
Updated At | Date/Time | UpdatedAt__c |
When the update happened |
π Step 2: Create the Batch Update Flow¶
- Go to Setup β Flows β New Flow.
- 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¶
- In the Flow Settings, click Set a Schedule.
- 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¶
- Go to App Launcher β Search Federation ID Update Logs.
- If needed, Create a Tab in Setup β Tabs β New Custom Object Tab.
- On the "Federation ID Update Logs" screen:
- Click the Gear Icon βοΈ.
- Click New List View.
- Name it something like:
All Logs
- or
Recent Federation Updates
- Set visibility to yourself or your admin group.
- Customize Columns:
- Add:
Email
,Old Federation ID
,New Federation ID
,Updated At
. - 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.