-
Notifications
You must be signed in to change notification settings - Fork 78
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 -r csv -q returns null string for null field instead of blank #1447
Comments
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. |
Hi, I'm having trouble repro, I followed your steps but the query returns no results, are you able to create a demo org with the object, field and record combination that are failing for you and then post it here ? (you can use dreamhouse-lwc as a template) |
@maggiben - Thanks for the update. I don't think this is related to the Org. You may run the command in another shell, or save the result into CSV files. If you are using Powershell, you may try to save the result to a variable and Write-Host it. |
Hi @gtiancai, I was unable to reproduce the error as well. I created the I then queried like you with
then saved that as you
and then was able to upsert it
I'm having a colleague try this out on his windows machine |
@WillieRuemmele - Thanks for the update! Did you check the batch result in Org? I believe above message just indicates the job is submitted successfully, not the actual result. |
oops, my bad. I just checked the status and it was successful
and the bulk status from the windows attempt
|
@WillieRuemmele - Thanks for the update! Now you can see the issue, right. Login to SF and download the batch result, you'll see the details. |
ahhh yes, it was right in front of me too
It starts working thank you for reporting this @W-10909335@ |
This bug is affecting me too. I think it's a fairly recent regression... within last 2 months? I ocassionally run a scripted export using sfdx and it failed today due to precence of "null" strings in export csv where empty fields were expected. sfdx-cli/7.142.1 win32-x64 node-v16.14.0 |
FYI: here's the fix |
@WillieRuemmele I think this can be closed? I've been using an older version of sfdx due to #1543 also affecting soql exports but that's now closed and fixed in 7.156.1 my soql exports are behaving as expected |
Summary
sfdx force:data:soql:query -r csv -q command returns null string for field which is null, instead of blank
Steps To Reproduce:
Create a object AA_Object
Create a restrict picklist field Type (Not required, 3 values: TA, TB, TC)
Create another text field Desc
Create a record with value: Type is null, Desc is "null"
run command: sfdx force:data:soql:query -r csv -q "SELECT Id, Type__c, Desc__c FROM AA_Object__c"
Save above CSV into a csv file (AARecords.csv)
run command
sfdx force:data:bulk:upsert -s AA_Object__c -f .\AARecords.csv -i Id
Expected result
Actual result
Both Type and Desc have same value: null
error: bad value for picklist
System Information
SFDX version:
{
"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"
}
The text was updated successfully, but these errors were encountered: