I'm trying to get the CompactLayout through package.xml but I don't its retrieving

here is my package.xml looks like:

    <members>my_custom_object__c-my compact layout</members> 

3 Answers 3


From documentation:

Compact layouts are defined as part of the custom object, standard object, or external object definition.

You need to have it defined in the Object's metadata xml definition as below:


Compact layout can be retrieved using objectname . compact layout name api as shown below. here oppcompact is compact layout name.


you can use https://packagebuilder.herokuapp.com/ to build your package.xml

  • Did not work, I tried exactly as you have objectname.compactlayoutapiname
    – Nick
    Commented Nov 7, 2018 at 1:27
  • this is working version. May be you are missing somehting else. Can you edit your question with screenshot of your compact layout api name and your complete xml. note: package.xml is case sensitive
    – Himanshu
    Commented Nov 7, 2018 at 2:01
    <members>my_custom_object__c-my compact layout</members> 

In first line you have mentioned as <type> please use <types> instead.

  • Please use the formatting tools in the editor to ensure your post looks correct. No one was able to read your post because bracketed items don't render unless marked as code.
    – David Reed
    Commented Aug 14, 2020 at 15:19

You must log in to answer this question.

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