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

7.140.0 sfdx force:data:soql:query extracting blank fields as 'null' rather than a no value #1430

Closed
timjr83 opened this issue Mar 4, 2022 · 3 comments
Labels
duplicate Issue or pull request already exists

Comments

@timjr83
Copy link

timjr83 commented Mar 4, 2022

From version 7.140.0 sfdx force:data:soql:query is extracting null/blank field values as a literal value of null

e.g.
FieldHeader1,FieldHerder2,FielderHeader3,FielderHeader4
Text value,null,null,text value

in previous versions the extracted csv would be:

FieldHeader1,FieldHerder2,FielderHeader3,FielderHeader4
Text value,,,text value

This is causing issues when subsequently using the csv file with the force:data:bulk:upsert command as it sees "null" as a literal text value.

@timjr83 timjr83 added the investigating We're actively investigating this issue label Mar 4, 2022
@github-actions
Copy link

github-actions bot commented Mar 4, 2022

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.

@eburtness
Copy link

eburtness commented Mar 4, 2022

I'm seeing the same. force:data:soql:query is outputting the string "null" for blank values instead of an empty string. This means a text field with a value of "null" produces the same output as having nothing in the field.

It looks like this was introduced in 7.138.0 with plugin data 0.6.9 so I'm suspicious of salesforcecli/plugin-data@801a7aa

Steps To Reproduce:

Repository to reproduce: dreamhouse-lwc

  1. Edit a record such that a field has a blank value. (I put the string "null" in another record to show how they are different but will come out the same from force:data:soql:query.)
  2. Retrieve records with force:data:soql:query in csv format

For example:
image

Expected result

With sfdx-cli/7.137.1 and data 0.6.8:

> sfdx force:data:soql:query -u DH -r csv -q 'SELECT Id, Tags__c, Name FROM Property__c ORDER BY Name LIMIT 3'
Id,Tags__c,Name
a018c00000T4YZ0AAN,contemporary,Architectural Details
a018c00000T4YYwAAN,,City Living
a018c00000T4YYzAAN,null,Contemporary City Living

Actual result

With sfdx-cli/7.138.0 and data 0.6.9:

> sfdx force:data:soql:query -u DH -r csv -q 'SELECT Id, Tags__c, Name FROM Property__c ORDER BY Name LIMIT 3'
Id,Tags__c,Name
a018c00000T4YZ0AAN,contemporary,Architectural Details
a018c00000T4YYwAAN,null,City Living
a018c00000T4YYzAAN,null,Contemporary City Living

(Same result with sfdx-cli/7.142.1)

System Information

{
        "cliVersion": "sfdx-cli/7.138.0",
        "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-diff 0.0.6",
                "@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.0 (core)",
                "schema 1.1.0 (core)",
                "sfdx-cli 7.141.0 (core)",
                "source 1.8.17 (core)",
                "telemetry 1.4.0 (core)",
                "templates 54.1.0 (core)",
                "trust 1.1.0 (core)",
                "user 1.7.1 (core)"
        ],
        "osVersion": "Windows_NT 10.0.19042"
}

@shetzel
Copy link
Contributor

shetzel commented Apr 7, 2022

Closing this as a duplicate of #1447 which has more activity. The fix is coming soon.

@shetzel shetzel closed this as completed Apr 7, 2022
@shetzel shetzel added duplicate Issue or pull request already exists and removed investigating We're actively investigating this issue labels Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants