I am working with a third party software solution that consumes Salesforce API data via WDSL. I can run queries on any of the tables to return the result object - this works fine.

I need to get data from Account AND a custom table called Marketing_attributes. Their relationship is well defined and works well as a child-parent or parent-child query. However, the results I get back are nested, e.g. The marketing fields are nested within a column of the Accounts object that is returned.

The software that I'm working with cannot handle the nested object.it just sees one extra colum "Marketing Attributes" and not it's child elements.

I have tried various ways of querying the data with brackets, with dot notation, with dot notation transversing up or down etc. But whatever I do, it still returns a nested result.

Is there a way I can flatten the results? The Salesforce example:

SELECT Id, FirstName__c, Mother_of_Child__r.FirstName__c
FROM Daughter__c
WHERE Mother_of_Child__r.LastName__c LIKE 'C%' 

Returns nested results - and this is basically how my query is setup today.

Any ideas? MAny thanks

  • What tool are you using and why cannot it be something else? Mar 6, 2020 at 13:43
  • it's our only option as we are committed to it. It's a third party location tool
    – Ali Brown
    Mar 6, 2020 at 14:08

1 Answer 1


That's how the API works. This is true for both REST and SOAP calls. If your software can't handle it, you need some middleware to translate the results. If you can call an executable, Salesforce CLI (SFDX) can output the query results as a CSV, which would be a flat table.

  • thank you very much. I'm waiting back to hear from the 3rd party
    – Ali Brown
    Mar 6, 2020 at 14:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .