function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Eric Smith 10Eric Smith 10 

What org settings would cause a SOQL query issued through the cli to return different results?

I'm issuing the following query via the cli:

force query "select masterlabel, id, lastModifiedBy.Name, lastModifiedDate, createdBy.Name, createdDate, VersionNumber, Status, ProcessType, Description from Flow" --format:csv tooling > file.csv

My typical result is a csv file with the following column headers:
CreatedBy.Name, CreatedDate, Description, Id, LastModifiedBy.Name, LastModifiedDate, MasterLabel, ProcessType, Status, VersionNumber

However, some orgs return a file with two extra columns (CreatedBy and LastModifiedBy) both of which contain no values:
CreatedBy, CreatedBy.Name, CreatedDate, Description, Id, LastModifiedBy, LastModifiedBy.Name, LastModifiedDate, MasterLabel, ProcessType, Status, VersionNumber

Any ideas what would cause this behavior?
Timothy Gentet O'BrienTimothy Gentet O'Brien
I believe you should technically be querying these fields, as you are going via a relationship field. This may be why you are seeing the eratic behaviour.
Eric Smith 10Eric Smith 10
I can query CreatedById and LastModifiedById but not CreatedBy nor LastModifiedBy.  I'm not sure why they are sometimes referenced in my query.