Title: Pulling related objects
Last modified: March 11, 2022

---

# Pulling related objects

 *  Resolved [smackey75](https://wordpress.org/support/users/smackey75/)
 * (@smackey75)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/pulling-related-objects/)
 * Is it possible to access data in a “related object” to the Salesforce object 
   being synced?
 * Apparently Salesforce lets you access the fields of relational objects with formulas
   using “__r” at the end of the API name instead of “__c”.
 * I’m wondering if “object_sync_for_salesforce_pull_params_modify” could be used
   or some other hook?
 * Here are a couple of examples of arrays that I want to add to the salesforce 
   pull query but am not sure how:
 * ( SELECT Website_Info__c FROM Online_Platforms__r ),
    ( SELECT Role__c, Talent__r.
   Name FROM Film_Credits__r )
 * Any help would be much appreciated.

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

 *  Plugin Author [Jonathan Stegall](https://wordpress.org/support/users/jonathanstegall/)
 * (@jonathanstegall)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/pulling-related-objects/#post-15449758)
 * If you want to modify the SOQL query that pulls data, consider [these hooks](https://github.com/MinnPost/object-sync-for-salesforce/blob/master/docs/extending-pull.md).
   You can filter the SOQL query while it’s still an object before it gets combined,
   or once it has been converted to a string.
 * I haven’t done any accessing of related objects with this plugin and I’m not 
   entirely sure it would work, but I’d be interested to hear if it does. Would 
   definitely put a link to it in the documentation, if there was a working example
   to share.
 *  Thread Starter [smackey75](https://wordpress.org/support/users/smackey75/)
 * (@smackey75)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/pulling-related-objects/#post-15455363)
 * Thanks for your quick reply. The _object\_sync\_for\_salesforce\_pull\_query\
   _modify_ looks like it could be modified to add to the query, and hopefully include
   the related object data in the result.
 * That said, I’m on a time crunch for the project I’ve inherited which has a custom
   salesforce to WordPress plugin. It was dated and broken, but I’ve managed to 
   get it working again and it does what I need with related objects so I’m sticking
   with it.
 * I will keep Object Sync for Salesforce in mind for future projects – it’s impressive.

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

The topic ‘Pulling related objects’ 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/)

 * 2 replies
 * 2 participants
 * Last reply from: [smackey75](https://wordpress.org/support/users/smackey75/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/pulling-related-objects/#post-15455363)
 * Status: resolved