Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Get Compact Layouts Using sObject CompactLayouts

Retrieves a list of compact layouts for a specific object. This resource is available in REST API version 29.0 and later.

Syntax

URI: /services/data/vXX.X/sobjects/sObject/describe/compactLayouts/

Formats: JSON, XML

HTTP methods: GET

Authentication: Authorization: Bearer token

Request parameters: None required

Example

Example Request

1curl https://MyDomainName.my.salesforce.com/services/data/v67.0/sobjects/Account/describe/compactLayouts -H "Authorization: Bearer token"

Example Response Body

If you haven’t defined any compact layouts for an object, the compactLayoutId returns as Null.

This sample JSON response is for compact layouts created on the Account object. In this example, only one custom compact layout was created for Account. The custom compact layout is assigned as the primary compact layout for the object, and it contains two fields: Account Name and Phone.

1{ 
2  "compactLayouts" : [ { 
3    "actions" : [ { 
4      "custom" : false, 
5      "icons" : null, 
6      "label" : "Call", 
7      "name" : "CallHighlightAction" 
8    }, { 
9      "custom" : false, 
10      "icons" : null, 
11      "label" : "Send Email", 
12      "name" : "EmailHighlightAction" 
13    }, { 
14      "custom" : false, 
15      "icons" : null, 
16      "label" : "Map", 
17      "name" : "MapHighlightAction" 
18    }, { 
19      "custom" : false, 
20      "icons" : null, 
21      "label" : "Read News", 
22      "name" : "NewsHighlightAction" 
23    }, { 
24      "custom" : false, 
25      "icons" : null, 
26      "label" : "View Website", 
27      "name" : "WebsiteHighlightAction" 
28    } ], 
29    "fieldItems" : [ { 
30      "editable" : false, 
31      "label" : "Account Name", 
32      "layoutComponents" : [ { 
33        "components" : [ ], 
34        "details" : { 
35          "autoNumber" : false, 
36          "byteLength" : 765, 
37          "calculated" : false, 
38          "calculatedFormula" : null, 
39          "cascadeDelete" : false, 
40          "caseSensitive" : false, 
41          "controllerName" : null, 
42          "createable" : true, 
43          "custom" : false, 
44          "defaultValue" : null, 
45          "defaultValueFormula" : null, 
46          "defaultedOnCreate" : false, 
47          "dependentPicklist" : false, 
48          "deprecatedAndHidden" : false, 
49          "digits" : 0, 
50          "displayLocationInDecimal" : false, 
51          "externalId" : false, 
52          "extraTypeInfo" : null, 
53          "filterable" : true, 
54          "groupable" : true, 
55          "htmlFormatted" : false, 
56          "idLookup" : false, 
57          "inlineHelpText" : null, 
58          "label" : "Account Name", 
59          "length" : 255, 
60          "mask" : null, 
61          "maskType" : null, 
62          "name" : "Name", 
63          "nameField" : true, 
64          "namePointing" : false, 
65          "nillable" : false, 
66          "permissionable" : false, 
67          "picklistValues" : [ ], 
68          "precision" : 0, 
69          "queryByDistance" : false, 
70          "referenceTo" : [ ], 
71          "relationshipName" : null, 
72          "relationshipOrder" : null, 
73          "restrictedDelete" : false, 
74          "restrictedPicklist" : false, 
75          "scale" : 0, 
76          "soapType" : "xsd:string", 
77          "sortable" : true, 
78          "type" : "string", 
79          "unique" : false, 
80          "updateable" : true, 
81          "writeRequiresMasterRead" : false 
82        }, 
83        "displayLines" : 1, 
84        "tabOrder" : 2, 
85        "type" : "Field", 
86        "value" : "Name" 
87      } ], 
88      "placeholder" : false, 
89      "required" : false 
90    }, { 
91      "editable" : false, 
92      "label" : "Phone", 
93      "layoutComponents" : [ { 
94        "components" : [ ], 
95        "details" : { 
96          "autoNumber" : false, 
97          "byteLength" : 120, 
98          "calculated" : false, 
99          "calculatedFormula" : null, 
100          "cascadeDelete" : false, 
101          "caseSensitive" : false, 
102          "controllerName" : null, 
103          "createable" : true, 
104          "custom" : false, 
105          "defaultValue" : null, 
106          "defaultValueFormula" : null, 
107          "defaultedOnCreate" : false, 
108          "dependentPicklist" : false, 
109          "deprecatedAndHidden" : false, 
110          "digits" : 0, 
111          "displayLocationInDecimal" : false, 
112          "externalId" : false, 
113          "extraTypeInfo" : null, 
114          "filterable" : true,
115          "groupable" : true,
116          "htmlFormatted" : false,
117          "idLookup" : false,
118          "inlineHelpText" : null,
119          "label" : "Account Phone",
120          "length" : 40,
121          "mask" : null,
122          "maskType" : null,
123          "name" : "Phone",
124          "nameField" : false,
125          "namePointing" : false,
126          "nillable" : true,
127          "permissionable" : true,
128          "picklistValues" : [ ],
129          "precision" : 0,
130          "queryByDistance" : false,
131          "referenceTo" : [ ],
132          "relationshipName" : null,
133          "relationshipOrder" : null,
134          "restrictedDelete" : false,
135          "restrictedPicklist" : false,
136          "scale" : 0,
137          "soapType" : "xsd:string",
138          "sortable" : true,
139          "type" : "phone",
140          "unique" : false,
141          "updateable" : true,
142          "writeRequiresMasterRead" : false 
143        }, 
144        "displayLines" : 1, 
145        "tabOrder" : 3, 
146        "type" : "Field", 
147        "value" : "Phone" 
148      } ], 
149      "placeholder" : false, 
150      "required" : false 
151    } ], 
152    "id" : "0AHD000000000AbOAI", 
153    "imageItems" : [ { 
154      "editable" : false, 
155      "label" : "Photo URL", 
156      "layoutComponents" : [ { 
157        "components" : [ ], 
158        "details" : { 
159          "autoNumber" : false, 
160          "byteLength" : 765, 
161          "calculated" : false, 
162          "calculatedFormula" : null, 
163          "cascadeDelete" : false, 
164          "caseSensitive" : false, 
165          "controllerName" : null, 
166          "createable" : false, 
167          "custom" : false, 
168          "defaultValue" : null, 
169          "defaultValueFormula" : null, 
170          "defaultedOnCreate" : false, 
171          "dependentPicklist" : false, 
172          "deprecatedAndHidden" : false, 
173          "digits" : 0, 
174          "displayLocationInDecimal" : false, 
175          "externalId" : false, 
176          "extraTypeInfo" : "imageurl", 
177          "filterable" : true, 
178          "groupable" : true, 
179          "htmlFormatted" : false, 
180          "idLookup" : false, 
181          "inlineHelpText" : null, 
182          "label" : "Photo URL", 
183          "length" : 255, 
184          "mask" : null, 
185          "maskType" : null, 
186          "name" : "PhotoUrl", 
187          "nameField" : false, 
188          "namePointing" : false, 
189          "nillable" : true, 
190          "permissionable" : false, 
191          "picklistValues" : [ ], 
192          "precision" : 0, 
193          "queryByDistance" : false, 
194          "referenceTo" : [ ], 
195          "relationshipName" : null, 
196          "relationshipOrder" : null, 
197          "restrictedDelete" : false, 
198          "restrictedPicklist" : false, 
199          "scale" : 0, 
200          "soapType" : 
201          "xsd:string", 
202          "sortable" : true, 
203          "type" : "url", 
204          "unique" : false, 
205          "updateable" : false, 
206          "writeRequiresMasterRead" : false 
207        }, 
208        "displayLines" : 1, 
209        "tabOrder" : 1, 
210        "type" : "Field", 
211        "value" : "PhotoUrl" 
212      } ], 
213      "placeholder" : false, 
214      "required" : false 
215    } ], 
216    "label" : "Custom Account Compact Layout", 
217    "name" : "Custom_Account_Compact_Layout"
218  } ], 
219  "defaultCompactLayoutId" : "0AHD000000000AbOAI", 
220  "recordTypeCompactLayoutMappings" : [ { 
221    "available" : true, 
222    "compactLayoutId" : "0AHD000000000AbOAI", 
223    "compactLayoutName" : "Custom_Account_Compact_Layout", 
224    "recordTypeId" : "012000000000000AAA", 
225    "recordTypeName" : "Master", 
226    "urls" : { 
227      "compactLayout" : "/services/data/v67.0/sobjects/Account/describe/compactLayouts/012000000000000AAA" 
228    } 
229  } ], 
230  "urls" : { 
231    "primary" : "/services/data/v67.0/sobjects/Account/describe/compactLayouts/primary" 
232  } 
233}