How can I get all page layouts from an org in Source Format?

Some things I've tried

# Retrieve

$ sfdx force:source:retrieve -m "Layout"
$ sfdx force:source:retrieve -m "Layout:My_Object__c"
$ sfdx force:source:retrieve -m "Layout:My_Object__c-My Object Layout"

=== Retrieved Source
No results found
# Converting from Metadata Format

# Given these files:
unpackaged/layouts/My_Object__c-My Object Layout.layout

$ sfdx force:mdapi:convert --rootdir unpackaged --outputdir src
No results found

Manual steps are ok, just need to do this one-time.

4 Answers 4


Retrieving specific layout:

sfdx force:source:retrieve -m "Layout:Account-Retail Account"
  • Object Name: Account
  • Layout Name: Retail Account
  • I forget that dash way too often because they use dot notation in other places for seperate things Commented Jun 5, 2020 at 17:44

I also tried the below commands and it worked fine.

sfdx force:source:retrieve -x ./manifest/package.xml


sfdx force:source:retrieve -m Layout

You may like to verify if you have the Layout attribute added in your package.xml

This has worked for me in VS Code, if at all you are open to this option.

  • Create a Project with Manifest
  • In the package.xml, specify the layouts (make sure you have it in package.xml), example as below:

  • Execute SFDX: Retrieve Source in Manifest from Org enter image description here

  • sfdx force:source:retrieve -m Layout worked well for me. I was only interested in Account layouts, so I simply deleted the others. Commented Jan 27, 2020 at 21:02

Layouts were ignored in .forceignore


Edit (answer before retrieved record type rather than page layout as pointed out by David Cheng):
Retrieving specific page layout into project (VS code SF CLI):
sfdx force:source:retrieve -m "Layout:sobject-pagelayoutname"

Page Layout Name: Equipment Finance
Object: Opportunity

To retrieve the above:

sfdx force:source:retrieve -m "Layout:Opportunity-Equipment Finance"
  • 1
    Your example retrieves the record type, not the layout. Commented Jul 9, 2021 at 23:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .