Solved

Salesforce Reader: Can a soql Select statement include Relational object like Parcel__r.Streetname

  • 4 December 2019
  • 3 replies
  • 4 views

The query below works in Dataloader and the Pentaho Kettle tool. But the Salesforce reader ignores the Parcel__r.xx fields. I see where @schatt15 posted here saying he used Dataloader in his SF Reader. But I don't see any option like that in SF reader. I'm using FME Workbench in ESRI 10.7 FME(R) 2019.0.0.0 (20190328 - Build 19238 - WIN32)

Thanks for your time.

Allan

Select 
Parcel__r.MUSW__Street_Number__c,
Parcel__r.MUSW__Street__c,  
Parcel__r.MUSW__City__c,
Parcel__r.MUSW__State__c,
Parcel__r.MUSW__Post_Zip_Code__c,
CreatedDate,NAME,Ordinance__c,
MUSW__Status__c,  
MUSW__Corrected_Date__c,GRASS_SQ_FT__C,
Age__c,
Code_Enforcement_Area__c,
Safe_Clean__c
FROM MUSW__Violation__c
WHERE CreatedDate = LAST_N_DAYS:100
icon

Best answer by jasonschroeder 6 December 2019, 16:58

View original

3 replies

@alamberthampton @bruceharold You will need to use the AttributeExposer transformer to expose any fields that you are querying via a relationship - whether standard or custom relationships. Below image is an example from a Salesforce query:

Account__r.Tier__c (Example in Salesforce Reader query: SELECT Account__r.Tier__c, FROM Child_object__c)

Any fields that are present in the query that exist in the object you are querying from will automatically show up as attributes in the workbench, but those that you pull from relationships will need to be exposed in the below manner. Connect the AttributeExposer to the Salesforce Reader and expose the attributes from the custom relationship:

  1. Parcel__r.MUSW__Street_Number__c
  2. Parcel__r.MUSW__Street__c
  3. Parcel__r.MUSW__City__c
  4. Parcel__r.MUSW__State__c
  5. Parcel__r.MUSW__Post_Zip_Code__c

Hope this helps!

@alamberthampton @bruceharold You will need to use the AttributeExposer transformer to expose any fields that you are querying via a relationship - whether standard or custom relationships. Below image is an example from a Salesforce query:

Account__r.Tier__c (Example in Salesforce Reader query: SELECT Account__r.Tier__c, FROM Child_object__c)

Any fields that are present in the query that exist in the object you are querying from will automatically show up as attributes in the workbench, but those that you pull from relationships will need to be exposed in the below manner. Connect the AttributeExposer to the Salesforce Reader and expose the attributes from the custom relationship:

  1. Parcel__r.MUSW__Street_Number__c
  2. Parcel__r.MUSW__Street__c
  3. Parcel__r.MUSW__City__c
  4. Parcel__r.MUSW__State__c
  5. Parcel__r.MUSW__Post_Zip_Code__c

Hope this helps!

Thanks @jasonschroeder That works perfectly. For future readers... you have to type in or paste these .r field names to the AttributeExposer...and select the regular fields. In the above example, he typed or pasted the first 5 and selected the last 1.

Thanks @jasonschroeder That works perfectly. For future readers... you have to type in or paste these .r field names to the AttributeExposer...and select the regular fields. In the above example, he typed or pasted the first 5 and selected the last 1.

I'm glad it worked. Please vote for this idea to support this type of query natively in the Salesforce Reader: https://knowledge.safe.com/idea/103959/automatically-expose-attributes-from-relationship.html?

Reply