+ Start a Discussion
Fraser RackhamFraser Rackham 

SFDX CLI - any way to return a list of fields (only) for a given object (fields only, not *all properties*)?

So, I can use the sfdx CLI command to get all the properties of an object using force:schema:sobject:describe -s OBJECT . However, this needs a fair bit of additional legwork to just get a list of fields. Is there a better command to use than the schema one?

From the excerpt below, I'd like to just get something like ['relationID', 'whoID']
{ actionOverrides: [],
  activateable: false,
  childRelationships: 
   [ { cascadeDelete: false,
       childSObject: 'AcceptedEventRelation',
       deprecatedAndHidden: false,
       field: 'RelationId',
       junctionIdListNames: [],
       junctionReferenceTo: [],
       relationshipName: 'AcceptedEventRelations',
       restrictedDelete: false },
     { cascadeDelete: true,
       childSObject: 'ActivityHistory',
       deprecatedAndHidden: false,
       field: 'WhoId',
       junctionIdListNames: [],
       junctionReferenceTo: [],
       relationshipName: 'ActivityHistories',
       restrictedDelete: false },
 
  • I have SFDX CLI working.
  • I can query SFDX from powershell if that is easier (and will if can't figure out an alternative).
Also, no DX category?