Service Match and PMM - Salesforce-org-Impact-Labs/01HousingandHomelessness GitHub Wiki
Service Match is an open source app developed and released by Impact Labs that allows case managers to refer services to people experiencing homelessness. PMM (https://powerofus.force.com/s/article/PMM-Overview) is an open source product that the Nonprofit Cloud team released that tracks Programs and Services. How can the two solutions work together?
Process Builder Solution
Avoid having to do double entry
Rather than having to enter programs in both PMM and Service Match, this setup example will allow programs to sync from PMM down to Service Match.
The process starts when a Program record is created or updated.
A task fires off via a process builder and does one of the following actions:
- If this is a new record in PMM, a new record will be created in Service Match.
- If this is an update to an existing record (a record exists in both PMM and Service Match where values in the mapped ID field match) the changes made in PMM will sync to Service Match.
What changes will I need to make in my system?
- Newly created programs from PMM to Service Match
- Location (Latitude) - required on Service Match
- Location (Longitude) - required for Service Match
- Name - mapped from Name in PMM
- Program - mapped from ID in PMM (this is a unique identifier that creates a relationship between PMM.Program and Service Match.Referal Program objects)
- Description - mapped from Description in PMM
- Updated programs from PMM to Service Match
- Name - mapped from Name in PMM
- Program - mapped from ID in PMM (this is a unique identifier that creates a relationship between PMM.Program and Service Match.Referral Program objects)
Implementation Steps:
Create a custom field that links records created in PMM to the corresponding record in Service Match.
- In Setup, go to the Object Manager tab and search for Referral Program (This Object will not exist if Service Match is not yet installed) and Edit the Referral Program Object.
- Go to Fields and Relationships
- Select New and for Data type select Lookup Relationship. Select Next.
- In the Related To dropdown, select Program and select Next.
- Keep the defaults and select Next
- Select Next through the next two screens and Save.
Create Criteria for newly created records:
Step 1: From setup, search for process builder and create a process with a process name of your choice. Choose the “A record changes” option from the drop down menu.
Select Save
Step 2:
Click on + Add Object Object: search for object “program” and select it from the list. Start the process: when a record is created or edited
Click on save
Step 3: Click on + Add Criteria Criteria Name: Enter what you want to name this criteria. For our example we used ‘Create Service Match Referral from PMM’ Criteria for Executing Actions: Formula evaluates to true Build Formula: ISNEW() - this will capture all new records Select Save
Step 4:
Under ‘Immediate Actions’ select + Add Action Action Type: Create a record Action Name: Unique name for action. for our example we used ‘Client Referral Program’ Record Type: Click in the box and select 'Select a record related to the pmdm__Program__c' → Referral_Programs__r
Criteria for Updating Records: No criteria - just update the records! Set Field Values: Enter values below:
- Location Latitude → Type Formula → paste the below formula $CustomMetadata.refrec__RefRecSettings__mdt.refrec__Organization_Default.refrec__Default_Latitude__c
- Location Longitude → Type Formula → paste the below formula $CustomMetadata.refrec__RefRecSettings__mdt.refrec__Organization_Default.refrec__Default_Longitude__c
- Name → Type field reference → from lookup search for name and select “Program Name”
- Program → Type field reference → from lookup search for name and select “Record ID”
- Description → Type field reference → from lookup search for description and select it.
- All Types → Multi-Select Picklist → Click in value field and move all types in Available to Selected - this will default all new programs come over with a type that is required for services to show up in Service Match.**Organizations may want to add a manual step to adjust this appropriately when new records are created.
- Type → Type field reference → from lookup search for and select Program Issue Area
Select Save
Create criteria to capture updates:
In order to ensure updates flow between linked records, we need to update the process builder to also look for update criteria.
Step 1: Click on + Add Criteria Criteria Name: Enter what you want to name this criteria. For our example we used ‘Update Service Match records’ Criteria for Executing Actions: Formula evaluates to true Build Formula: NOT(ISNEW()) - this will capture updates to records Select Save
Step 2: Under ‘Immediate Actions’ select + Add Action Action Type: Update Records Action Name: Unique name for action. for our example we used ‘Update referral program record’ Record Type: Referral Programs
Set Field Values: Enter values below:
Name → Type field reference → from lookup search for name and select “Program Name” Description → Type field reference → from lookup search for description and select it. Type → Type field reference → from lookup search for and select Program Issue Area
Select save
FAQ (WIP):
Q: Will these updates flow both ways?
A: No, the suggested setup only pushes changes made in PMM to Service Match
Q: What if I’m already using PMM?
A: This is fine! Go head and install Service Match and then complete the steps listed above to have data from PMM begin to flow into Service Match.
Q: What if I have records in Service Match already?
A: It is recommended that you take a look at your data prior to implementing to determine the best path forward. If you have been using PMM and Service match separately, there is a risk of you introducing duplicate data into Service Match with the above setup. The setup detailed above requires a mapped field to connect the records between PMM and Service Match. Once that mapped field is created, any new record created or updated in PMM will try to find a corresponding record in Service Match. If it cannot find a matching ID it will assume that this is a new record and will create a new record in Service Match.