Repository for WfWI integrations for: BambooHR, MS Azure Active Directory
master
will be audo-deployed to OpenFn.org. Always work on a branch![PROD]
jobs to sync with the live production environment. Choose to keep the [TEST]
jobs running in parallel for testing purposes.Women for Women International would like to integrate Committed Giving with Salesforce. OpenFn will sync donation data from Committed Giving to Salesforce. In addition, OpenFn to perform duplicate checking before upserting data.
⭐📖 See this Drive folder for the compiled solution documentation and diagrams.
Flow: Committed Giving --> Salesforce
See data flow here https://lucid.app/lucidchart/34c8100a-42d2-47ab-8a5a-6c406a744ed8/edit?beaconFlowId=53F1EDFE7A9CEC2A&page=0_0#
See the V2 spec for the latest detailed documentation on the current field mapping logic.
The CSV files map to these Salesforce objects as shown below:
Donors
CSV triggers upsertDonors.js
job, which checks for duplicates and upserts Salesforce objects Contact
(This also looks up Accounts
).
Direct Debit
CSV triggers upsertDirectDebits.js
job, which upserts Salesforce objects Recurring Donations
and Opportunity
.
Transaction-DD
CSV triggers upsertTransactionDD.js
job, which upserts Salesforce objects Recurring Donation
and Opportunity
.
Custom DD details
CSV triggers upsertCustomDD.js
job, which upserts Salesforce object Opportunity
.
Card master
CSV triggers upsertCardMaster.js
job, which upserts Salesforce objects Recurring Donation
and Opportunity
.
Transaction-card
CSV triggers upsertTransactionCards.js
job, which upserts Salesforce objects Recurring Donation
and Opportunity
.
Custom CC details
CSV triggers upsertCustomCC.js
job, which upserts Salesforce object Opportunity
Contacts: Legacy_Supporter_ID__c
comes from PersonRef
.
Recurring Donations:
For direct debits, configured External ID Committed_Giving_ID__c
comes from PrimKey
+DDId
.
For card master, configured External ID Committed_Giving_ID__c
comes from PrimKey
+CardMasterID
.
For transactions DD, configured External ID Committed_Giving_ID__c
comes from PrimKey
+DDRefforBank
.
For transactions card, configured External ID Committed_Giving_ID__c
comes from PrimKey
+CardMasterID
+TransactionReference
.
Opportunity:
For card master, configured External ID CG_Pledged_Donation_ID__c
comes from CardMasterID
, RecurringCancelDate
, Occurrence
, LastCredited
, NextDate
For transaction cards, configured External ID CG_Pledged_Donation_ID__c
comes from CardMasterID
+Transaction Date
+ "Pledged".
For direct debits, configured External ID Committed_Giving_ID__c
comes from DDid
+CancelDate
+PaymentFrequency
+LastClaimDate
+NextDate
.
For transactions DD, configured External ID Committed_Giving_ID__c
comes from DDid
+Date
+"Pledged".
Job 1 gets the CSV files from Committed Giving and converts them to JSON. CSV files include: Donors
, Direct Debit
, Transaction-card
, Transaction-DD
, Custom CC details
and Custom DD details
. See link to this job: https://github.com/OpenFn/women-for-women/blob/master/jobs/committed/1.fetchJSON.js
The upsertDonors.js
job checks for duplicates and upserts Salesforce objects Contact
. Link here: https://github.com/OpenFn/women-for-women/blob/master/jobs/committed/upsertDonors.js
TheupsertDirectDebits.js
job upserts Salesforce objects Recurring Donations
and `Opportunity. This job also does the following: 1) marks Open Ended Status as "Closed" on Recurring Donations to deactivate NPSP automation 2)schedules future “pledged” Opportunities & 3) closes future “pledged” Opportunities for canceled recurring donations. Link here: https://github.com/OpenFn/women-for-women/blob/master/jobs/committed/upsertDirectDebits.js
The upsertTransactionDD.js
job upserts Salesforce objects Recurring Donation
. Salesforce automatically creates related Opportunity
and Payment
. This job also 1)marks “pledged” Opportunities for “unpaid” transactions as “Closed Lost” & 2)marks “pledged” Opportunities for “paid” transactions as “Closed Won”. Link here: https://github.com/OpenFn/women-for-women/blob/master/jobs/committed/upsertTransactionDD.js
The upsertCustomDD.js
job upserts Salesforce object Opportunity
. link here: https://github.com/OpenFn/women-for-women/blob/master/jobs/committed/upsertCustomDD.js
The upsertCardMaster.js
job, upserts the Salesforce object Recurring Donation
then Salesforce automatically creates related Salesforce Objects Opportunity
and Payment
. This also job does the following: 1) marks Open Ended Status as "Closed" on Recurring Donations to deactivate NPSP automation 2)schedules future “pledged” Opportunities & 3) closes future “pledged” Opportunities for canceled recurring donations. Link here: https://github.com/OpenFn/women-for-women/blob/master/jobs/committed/upsertCardMaster.js
TheupsertTransactionCards.js
upserts Salesforce object Recurring Donation
of Type Sponsorship
, if the amount is a multiple of 22. Otherwise, it upserts Salesforce objects Recurring Donation
of Type Recurring Donation
and creates Salesforce object Opportunity
with Stage
of Closed Won
. In addition, if the amount is NOT a multiple of 22 and the count of transactions on a card master is more than one, it creates the Salesforce object Opportunity
with a Donation Type
of General Giving
and Stage
of Closed Won
. This job also 1)marks “pledged” Opportunities for “unpaid” transactions as “Closed Lost” & 2)marks “pledged” Opportunities for “paid” transactions as “Closed Won”. Link here: https://github.com/OpenFn/women-for-women/blob/master/jobs/committed/upsertTransactionCards.js
The upsertCustomCC.js
job upserts Salesforce object Opportunity
. link here: https://github.com/OpenFn/women-for-women/blob/master/jobs/committed/upsertCustomCC.js
Trigger Type: Message Filter A message filter trigger has been configured for each above. The job will run when a CSV file with the matching message filter is received in the project inbox.
SFTP adaptor and Salesforce adaptor
OpenFn will send automated email notifiers if:
This integration automates a complex donor duplicate-check flow before upserting Salesforce Contacts
. Please see [this diagram: CG <> Salesforce Contact Integration Flow] https://lucid.app/lucidchart/4d0b44a8-3299-431f-84b5-4b00bc713cd7/edit?beaconFlowId=BD5CBE391A037FF2&page=yw0MswWCJIR2# for a summary of the WfWI CG Contacts Duplicate Checking & Sync Logic.
We assume that Committed Giving will name the CSV files with the following keywords: `wfwi donors' 'wfwi card master' 'wfwi direct debits' 'wfwi transactions - cards' 'wfwi transactions - dd' 'wfwi custom cc fields' 'wfwi custom dd fields'
New campaign codes will be added directly in Salesforce.
All donations prior to 01/01/2020 should be logged in Salesforce already.
For every Recurring Donation
created, Salesforce automatically creates related Opportunity
and Payment
.
See here for the video walkthrough of the OpenFn setup.
This solution enables Women for Women administrators to automate employee registration processes to save time syncing data between their BambooHR
system and Microsoft Azure AD
(via the Microsoft Graph API
).
OpenFn configured a prototype integration to pilot this data flow by first focusing on automation for new Employee registrations & updates. In subsequent phases, we may expand this automation to handle other employee scenarios (i.e., employee termination, contractor employees, etc.).
Please see this data diagram for a review of the solution: Data Flow Diagram
BambooHR has a webhook notification service that will send OpenFn real-time notifications when changes are made to employee records in Bamboo. The fields included in this notification & how they map to Azure are listed in this mapping specification.
Depending on the Employment Status, different actions may be taken beyond Azure user record updates.
Active Divisions
will be processed by the automation flow. Otherwise, the automation will skip over the record and log No Azure action taken
. Skip to 02:08
in this video for instructions on updating the activeDivision
list, and please update the following lines in these jobs:
1. Upsert Azure User
- see L292 (const activeDivisions = ['Headquarters', 'Headquarters - PM Access'];
)
https://github.com/OpenFn/women-for-women/blob/master/jobs/production/upsertUserProd.js#L2922A. Send Welcome Email
- see L16
https://github.com/OpenFn/women-for-women/blob/master/jobs/production/sendWelcomeEmailProd.js#L162B. Send Supervisor Email
- see L16
https://github.com/OpenFn/women-for-women/blob/master/jobs/production/sendSupervisorEmailProd.js#L163. Send Inactive Employee Email
- see L16
https://github.com/OpenFn/women-for-women/blob/master/jobs/production/sendInactiveEmailProd.js#L16For this pilot integration setup, OpenFn will sync BambooHR Employee
information with AzureAD users
in a one-directional data flow. This includes automation to execute the following actions in Azure:
users
manager
user
as a member to administrativeUnits
user
as a member to groups
(and thereby assign licenses)Authentication successful
Assigning ${fields['First name Last name']} (${employee.fields.Employee #} to manager ${supervisorEmail} ...
Manager ${employee.fields['Supervisor email']} not found...
Removing member from the administrative unit ${value[0]}...
Adding member to the administrative units ${employee.fields.Division}...
Removing member from the group ${value[0]}...
Adding member to the group ${employee.fields['Email User Type']}...
No Azure actions taken because 'Work Email' not provided.
Updating ${employee.fields.First name Last name} (${employee.fields.Employee #} information...
No Azure changes made. Employment Status does not qualify for integration. Nothing to update for ${employee.fields.First name Last name} (${employee.fields.Employee #} at this time.
${employee.fields.First name Last name} User Principal Name ($UserPrincipalName}) and Bamboo Work Email ({$employee.Work Email}) do not match. Please review this employee {employee.Employee #} to confirm the email and UPN are correct.
Creating a new user for ${employee.fields.First name Last name} ...
OpenFn is leveraging the adaptor language-http
to connect with the Microsoft Graph API
in order to perform operations in Azure AD and across other Microsoft products. See API Docs: https://docs.microsoft.com/en-us/graph/
on behalf of a user
- see docs hereDelegated Permissions
via the API Permissions menu item in the Azure AD PortalDiscussed functionality may include:
Contact support@openfn.org.