Skip to content

hardis:org:multi-org-query

Description

Executes a SOQL query in multiple orgs and generate a single report from it

You can send a custom query using --query, or use one of the predefined queries using --query-template.

If you use the command from a CI/CD job, you must previously authenticate to the usernames present in --target-orgs.

Use in VsCode SFDX Hardis !

Parameters

Name Type Description Default Required Options
debug
-d
boolean Activate debug mode (more logs)
flags-dir option undefined
json boolean Format output as json.
outputfile
-f
option Force the path and name of output report file. Must end with .csv
query
-q
option SOQL Query to run on multiple orgs
query-template
-t
option Use one of predefined SOQL Query templates active-users
all-users
skipauth boolean Skip authentication check when a default username is required
target-orgs
-x
option List of org usernames or aliases.
websocket option Websocket host:port for VsCode SFDX Hardis UI integration

Examples

$ sf hardis:org:multi-org-query
$ sf hardis:org:multi-org-query --query "SELECT Id,Username FROM User"
$ sf hardis:org:multi-org-query --query "SELECT Id,Username FROM User" --target-orgs nico@cloudity.com nico@cloudity.com.preprod nico@cloudity.com.uat
$ sf hardis:org:multi-org-query --query-template active-users --target-orgs nico@cloudity.com nico@cloudity.com.preprod nico@cloudity.com.uat