Title: Conditionally syncing
Last modified: July 18, 2022

---

# Conditionally syncing

 *  Resolved [chercka](https://wordpress.org/support/users/chercka/)
 * (@chercka)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/conditionally-syncing/)
 * Is it possible to _conditionally_ sync objects from SF to WP?
    I don’t see it
   as a fieldmap option.
 * Specifically I’d like to only sync SF Users into a WP Custom Post Type if the
   SF user has certain fields set.
    For example only pull into WP the SF users that
   have roleID === X?
 * Ignore all the others.
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Jonathan Stegall](https://wordpress.org/support/users/jonathanstegall/)
 * (@jonathanstegall)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/conditionally-syncing/#post-15836616)
 * It is, but only with developer hooks. I don’t really provide support for the 
   developer hooks here, but there is documentation about how you might do this 
   specific thing. See [this page](https://github.com/MinnPost/object-sync-for-salesforce/blob/master/docs/extending-sync-allowed.md#pull).
 *  Thread Starter [chercka](https://wordpress.org/support/users/chercka/)
 * (@chercka)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/conditionally-syncing/#post-15839793)
 * Thanks Jonathan!
 *  [blipps](https://wordpress.org/support/users/blipps/)
 * (@blipps)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/conditionally-syncing/#post-15966802)
 * I have a question about the hook you referred to, Jonathan. Do the fields have
   to be in the fieldmap for the conditionals to work? I will need to use this functionality.
   However, I don’t necessarily need to store that information. Just need to check
   it to see if the given record should be imported.
 *  Plugin Author [Jonathan Stegall](https://wordpress.org/support/users/jonathanstegall/)
 * (@jonathanstegall)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/conditionally-syncing/#post-15966954)
 * [@blipps](https://wordpress.org/support/users/blipps/) good question. You could
   try it and see, but I think by default it probably would need to be in the fieldmap
   because `$object` is the result of a Salesforce API call that uses the fields
   in the fieldmap.
 * If that’s correct, I think if you wanted to, you could use [ object_sync_for_salesforce_pull_query_modify](https://github.com/MinnPost/object-sync-for-salesforce/blob/master/docs/extending-pull.md#soql-object)
   to modify the query and add those other fields in to the resultset, and then 
   use `object_sync_for_salesforce_pull_object_allowed` to work with those fields.
   I’d test it a lot, but it is probably possible.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Conditionally syncing’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/object-sync-for-salesforce.svg)
 * [Object Sync for Salesforce](https://wordpress.org/plugins/object-sync-for-salesforce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/object-sync-for-salesforce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/object-sync-for-salesforce/)
 * [Active Topics](https://wordpress.org/support/plugin/object-sync-for-salesforce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/object-sync-for-salesforce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/object-sync-for-salesforce/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Jonathan Stegall](https://wordpress.org/support/users/jonathanstegall/)
 * Last activity: [3 years, 9 months ago](https://wordpress.org/support/topic/conditionally-syncing/#post-15966954)
 * Status: resolved