Search Results :

×

Filter Synchronization of Salesforce records to WordPress objects based on Salesforce fields


Salesforce contains a wide range of data, but often, businesses only need to sync and display specific records on their WordPress site for better relevance and efficiency. The goal here is to selectively pull and sync only certain Salesforce records into WordPress as users or custom posts based on specific criteria.

To achieve this, only records that meet predefined conditions in Salesforce are transferred, ensuring that only relevant data is fetched. This process keeps WordPress data both targeted and streamlined, displaying only essential information from Salesforce on your website.

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.


We have two solutions to add filtering:

  1. Filtering in Real - Time Sync
  2. Filtering in Bulk - Pull of Data

Components Involved

Object Data Sync for Salesforce Enterprise plugin is used to sync any Salesforce object details (for example, User details that are stored as Salesforce objects) into WordPress.

If you want the Enterprise version of the plugin or have any questions related to your use-case, you can contact us at salesforcesupport@xecurify.com.


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.

Solution

WordPress Object Data Sync for Salesforce Enterprise plugin should be installed and establish a successful connection with Salesforce.

This use case can be accomplished in two ways as below:


  • Real - Time Sync
  • Bulk - Pull of Data

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 refer to the below steps to set up the filtering of records based on your criteria/conditions. The triggered record will be synced to WordPress in real time only if the conditions are evaluated to be true.


Steps to configure filter conditions in Salesforce Flows:


  • In the App setup, navigate to Process Automation >> Flows and click on the flow you configured with the outbound message for the Account Salesforce object.
  • Click on the Record-Triggered Flow (starting node of the flow) button.
  • Filter Salesforce Records Sync to WordPress | Process Automation Flows
  • Click on the Edit link.
  • Filter Salesforce Records Sync to WordPress | Edit Flow
  • On the new dialog box opened, under the heading Set Entry Conditions, select All Conditions Are Met (AND) option, 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). Choose Equals as the operator. Enter the value for which you want to trigger sync for the record (which is Provider in your case).
  • Click on the Add Condition button to add AND conditions.
  • Check the Every time a record is updated and meets the condition requirements radio button.
  • Click the Done button.
  • Filter Salesforce Records Sync to WordPress | Set Entry Conditions
  • Click on Save As button.
  • Filter Salesforce Records Sync to WordPress | Save As
  • Click the Save button to save the flow.
  • Filter Salesforce Records Sync to WordPress | Save the Flow
  • Click the Activate button to initialize the flow.
  • Filter Salesforce Records Sync to WordPress | Activate Flow
  • 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.

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. 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 instructions below to set Advance Search Options for pulling filtered data from Salesforce to your WordPress site:


  • Go to the Advance Search Options tab of the Object Data Sync for Salesforce plugin and activate the toggle Enable Advance Search Option.
  • Filter Salesforce Records Sync to WordPress | Enable Advance Search Option
  • Go to Object Mapping created by you in the plugin. 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 button.
    Note: You can prepare the WHERE condition as per the below mentioned instructions.
  • 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.
  • Filter Salesforce Records Sync to WordPress | Advance Search Option
  • If the query is correct, then navigate to the Advance Sync Options tab of the plugin. 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.
  • Filter Salesforce Records Sync to WordPress | Advance Search Option

You can refer the below SOQL Query for 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 that 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.

Conclusion

This way, you can synchronize only filtered data coming from your Salesforce instance to your WordPress site, ensuring that you manage and present only relevant information efficiently. This can be done using either methods, that is, adding criteria or conditions within real-time synchronization operations or during bulk synchronization procedures, thus allowing flexibility and precision when handling your data integration.


Additional Resources

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


Hello there!

Need Help? We are right here!

support