Search Results :

×

Sync Salesforce Contacts to WordPress with Custom Filters


Salesforce offers a great way to store different types of information through custom objects and fields tailored to your needs. However, businesses often want this data to show up on their WordPress websites for customers to see. To make this happen, we need to keep the data synchronized between Salesforce and WordPress.

That's where the Object Data Sync for Salesforce plugin comes in handy. It lets you sync data between Salesforce objects and WordPress posts, whether they're custom or standard. Plus, you can schedule these syncs to happen at intervals you choose. This ensures that the data displayed on your WordPress site is always up-to-date with the latest info from Salesforce.

Scenario

The members are stored as contacts in Salesforce, and the customer requires these contacts to be synchronized as users in WordPress. However, they don't want to sync all contacts to WordPress; only a few selected ones. These specific contacts to be synced will typically be determined by specific field values, for example, a checkbox field such as Is Active Member. If this checkbox is checked (set to true), the end-user would like to sync that contact to WordPress as a user. This ensures that only active members/Contacts are synced to WordPress as users.

Requirements

1. Real-Time Data Filtering from Salesforce to WordPress.

2. Bulk data pull from Salesforce to WordPress using filtering conditions.

Components Involved

  • WP Object Data Sync for Salesforce: This plugin enables real-time data synchronization between WordPress and Salesforce. It handles real-time data filtering and bulk data transfer from Salesforce to WordPress.


WordPress Salesforce Object Sync | Sync Salesforce Objects bidirectionally with WordPress. Enable real-time sync, scheduled sync, Salesforce Sync with Workflows Automation, sync leads from WordPress to Salesforce, Salesforce ACF/CPT UI integrations, and more.

 Tested with 6.6

Solution:

Flow 1

1. Real-Time Sync Filtering: To enable real-time filtering of selected Salesforce records with WordPress, ensuring that only records meeting specific criteria are synced. This involves evaluating whether newly created or updated Salesforce records satisfy predefined conditions before syncing them to WordPress as users or custom post types.

You can follow the steps given below to configure filtering conditions for syncing data from Salesforce to WordPress in Real-Time:

  • Go to Salesforce App Setup and navigate to Process Automation >> Flows. Then click on the flow you configured with the outbound message for the Account Salesforce object.
  • Then click on the starting node of the flow as shown below :
  • Salesforce Job Manager | Second Workflow
  • Click on the Edit option as shown below.
  • Salesforce Job Manager | Second Workflow
  • On the new dialog box opened, under the heading Set Entry Conditions. Select All Conditions Are Met (AND). Then add the condition to the fields per the report's conditions.
  • For your case, search for the Salesforce field upon whose value you want to apply the conditions (which would be the Record Type Name in your case). Select ‘Equals’ as the operator. Enter the value for which you want to trigger sync for the record (which is Provider in your case).
  • You can add as many AND conditions you want to be held by clicking on the Add Condition button.
  • Check the radio button titled Every time a record is updated and meets the condition requirements.
  • Now click on Done.
  • Salesforce Job Manager | Second Workflow
  • Then Click on Save As and then click on Save the Flow.
  • Salesforce Job Manager | Second Workflow Salesforce Job Manager | Second Workflow
  • Now click on the Activate button to activate the flow.
  • Salesforce Job Manager | Second Workflow
  • Now, trigger any Account record. Only those records satisfying the conditions (equivalent to the conditions added in the Account Report ) will eventually be synced to WordPress.

Flow 2

2. Bulk Pull of Data Filtering: The Bulk Pull Operation pulls all the existing/historical records present in the configured Salesforce Object to WordPress users/custom post type based on the WordPress object you have mapped to. If you have the requirement for pulling only selected records to WordPress, for example, pulling all the Contact Records whose Membership_Status__c is Active.

You can follow the steps given below to configure filtering conditions to Pull Bulk data from Salesforce to WordPress:

  • Navigate to the Advance Search Options tab of the Object Data Sync for Salesforce plugin and activate the toggle titled Enable Advance Search Option.
  • Salesforce Job Manager | Second Workflow Salesforce Job Manager | Second Workflow
  • Go to the Object mapping created by previously in the plugin. Then click on Edit and save it.
  • Now navigate back to the Advance Search Options tab of the plugin and enter the where clause for the mapping according to which you want to pull data from Salesforce and click on Save. You can prepare the WHERE condition as per the instructions given at the end of this email.
  • Once you save the 'Where Condition' for a mapping click on the Test Query button, this will let you know whether the query entered by you is correct or not.
  • Salesforce Job Manager | Second Workflow
  • If the query is correct, then navigate to the 'Advance Sync Options' tab of the plugin now scroll down to the One Time Pull section and click on the Pull button, this will pull records to your WordPress site according to the where clause added by you in the Advance Search Options tab of the plugin.
  • Salesforce Job Manager | Second Workflow
  • You can refer to the SOQL Query below for an example of preparing the WHERE clause.
  • SELECT Firstname, Lastname FROM Contact WHERE BussinessGroup = ABC' OR BussinessGroup='PQR' AND Membership_Status__c = ‘Active’

  • You would only need to add the WHERE clause conditions in the WHERE condition column as shown in the image shared above. Then, the plugin would perform an API call using this SOQL query and only pull all those records( filter out the records ) from Salesforce that would satisfy the condition specified by you.
  • In the above case, records having the value ABC or PQR in the BusinessGroup field and Membership_Status__c as Active will be pulled.
  • Note : The records will be pulled according to this SOQL query once you click on the "Pull" button present in the "One Time Pull" section under the Advance Sync Options in the plugin. If the 'where clause' is not added for a mapping then the plugin will run the standard SOQL query (i.e., without the WHERE condition) to pull records from salesforce, thereby pulling all the records according to that mapping.

We offer Secure Identity Solutions for Single Sign-On, Two Factor Authentication, Adaptive MFA, Provisioning, and much more. Please contact us at

 +1 978 658 9387 (US) | +91 97178 45846 (India)    salesforcesupport@xecurify.com


[MO_CONTACT_US]

Hello there!

Need Help? We are right here!

support
Contact miniOrange Support
success

Thanks for your inquiry.

If you dont hear from us within 24 hours, please feel free to send a follow up email to info@xecurify.com