Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sfdx force:data:soql:query merges relationship fields and do not display any value #1473

Closed
somyasrivas opened this issue Apr 11, 2022 · 2 comments
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@somyasrivas
Copy link

Summary

When querying data with sfdx force:data:soql:query, relationship fields get combined and do not display any value in the output.
If single relationship fields exist then it displays properly, but if there is more than 1 relationship field in the query, then both fields get combined and do not display any value.

Steps To Reproduce:

  1. sfdx force:data:soql:query -q "SELECT CreatedDate , Sobject1__r.Sobject2__r.Some_Field1__c, Sobject1__r.Sobject2__r.Some_Field2__c" -u username -r csv

ex: sfdx force:data:soql:query -q "SELECT Id, Opportunity.Account.Name, Opportunity.Account.OwnerId FROM OpportunityHistory" -u [email protected] -r csv

  1. Note that the output fields are CreatedDate and Sobject1__r.Sobject2__r.Some_Field1__c.Some_Field2__c
    The value for Sobject1__r.Sobject2__r.Some_Field1__c.Some_Field2__c is blank

Expected result:
I should get the value of Id and Sobject1__r.Sobject2__r.Some_Field1__c, Sobject1__r.Sobject2__r.Some_Field2__c in my output.

Actual result:
I get the Id and Sobject1__r.Sobject2__r.Some_Field1__c.Some_Field2__c column and value for 2nd column blank in my output.

output

  1. Remove any one of the relationship fields from the query, then it displays the correct result:
    ex: sfdx force:data:soql:query -q "SELECT Id, Opportunity.Account.Name FROM OpportunityHistory" -u [email protected] -r csv

System Information

  • Run sfdx version --verbose --json:

{
"cliVersion": "sfdx-cli/7.142.1",
"architecture": "win32-x64",
"nodeVersion": "node-v16.14.0",
"pluginVersions": [
"@oclif/plugin-autocomplete 0.3.0 (core)",
"@oclif/plugin-commands 1.3.0 (core)",
"@oclif/plugin-help 3.3.1 (core)",
"@oclif/plugin-not-found 1.2.6 (core)",
"@oclif/plugin-plugins 1.10.11 (core)",
"@oclif/plugin-update 1.5.0 (core)",
"@oclif/plugin-warn-if-update-available 1.7.3 (core)",
"@oclif/plugin-which 1.0.4 (core)",
"@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)",
"alias 1.2.1 (core)",
"apex 0.11.0 (core)",
"auth 1.8.1 (core)",
"community 1.1.4 (core)",
"config 1.3.23 (core)",
"custom-metadata 1.0.12 (core)",
"data 0.6.9 (core)",
"generator 1.2.2 (core)",
"info 1.3.0 (core)",
"limits 1.3.0 (core)",
"org 1.11.2 (core)",
"salesforce-alm 54.0.1 (core)",
"schema 1.1.0 (core)",
"sfdx-cli 7.142.1 (core)",
"source 1.8.18 (core)",
"telemetry 1.4.0 (core)",
"templates 54.2.0 (core)",
"trust 1.1.0 (core)",
"user 1.7.1 (core)"
],
"osVersion": "Windows_NT 10.0.19042"
}

version

Similar discussion:
https://trailhead.salesforce.com/en/trailblazer-community/feed/0D54S00000EAb6vSAD

@somyasrivas somyasrivas added the investigating We're actively investigating this issue label Apr 11, 2022
@github-actions
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@shetzel shetzel added bug Issue or pull request that identifies or fixes a bug and removed investigating We're actively investigating this issue labels Apr 11, 2022
@forcedotcom forcedotcom deleted a comment from uip-robot-zz Apr 11, 2022
@shetzel shetzel added bug Issue or pull request that identifies or fixes a bug and removed bug Issue or pull request that identifies or fixes a bug labels Apr 11, 2022
@shetzel
Copy link
Contributor

shetzel commented Apr 11, 2022

Associated work item: W-10977978

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug
Projects
None yet
Development

No branches or pull requests

3 participants