Customize the layout of a workbook in code representation (Beta)

View as Markdown

This documentation describes one or more private beta features that are in development. Beta features are subject to quick, iterative changes; therefore the current user experience in the Sigma service can differ from the information provided in this page.

This page should not be considered official published documentation until Sigma removes this notice and the beta flag on the corresponding feature(s) in the Sigma service. For the full beta feature disclaimer, see Beta features.

If you are interested in joining a limited test group and enabling this feature in your Sigma organization, contact Support or reach out to your Account Executive.

You can customize the layout of a workbook page in the code representation using the document.layout field. The layout field is an XML string that controls which page each element belongs to, and the size and position of each element on that page using a 24-column grid system. To control how elements are arranged on a page when you create or update a workbook using the API, specify the layout in the representation.

When you retrieve the representation of an existing workbook using the Get the code representation of a workbook endpoint, the layout field populates automatically based on the arrangement of elements on each page in the published version.

The layout field is required. Every element in document.elements must be placed in the layout, because the layout is what assigns an element to a page. A representation with an element the layout never references is rejected with an error naming that element, such as elements[0]: element 'ammWveJOET' is not placed in layout.

Example representation with layout

The following example shows a YAML representation of a workbook with a table and a bar chart. Both elements span the full width of the page and are stacked vertically, one above the other.

1workbookId: bc9e239e-6e00-4f0f-a5b1-2e16df3245a2
2name: bar-chart
3url: https://aws-api.sigmacomputing.com/org-name/workbook/bar-chart-K6nD3mi0cQAx9f8rriM64z
4documentVersion: 2
5latestDocumentVersion: 2
6ownerId: TnQGIaVmMru7kyHwWPCQfUWjypPtZ
7folderId: b6c4f574-9ab6-4525-b25a-b45ed39b5e05
8createdBy: TnQGIaVmMru7kyHwWPCQfUWjypPtZ
9updatedBy: TnQGIaVmMru7kyHwWPCQfUWjypPtZ
10createdAt: '2026-04-20T20:09:52.987Z'
11updatedAt: '2026-04-21T14:22:44.075Z'
12document:
13 schemaVersion: 1
14 kind: workbook
15 elements:
16 - id: ammWveJOET
17 kind: table
18 source:
19 connectionId: 6944db1a-f9f0-496f-91ba-4781e7f0490d
20 kind: warehouse-table
21 path:
22 - FUN
23 - BIKES
24 - TRIP
25 columns:
26 - id: VGGdL5h1XL
27 formula: '[TRIP/Id]'
28 - id: XfekGVjpYe
29 formula: '[TRIP/Duration]'
30 - id: vSNXcQlbgo
31 formula: '[TRIP/Start Date]'
32 - id: n0viQISda6
33 formula: '[TRIP/Start Station Name]'
34 - id: otGGHmPqJZ
35 formula: '[TRIP/Start Station Id]'
36 - id: jrQpKNxZxF
37 formula: '[TRIP/End Date]'
38 - id: xT5p03z0yD
39 formula: '[TRIP/End Station Name]'
40 - id: kctIxpAAqM
41 formula: '[TRIP/End Station Id]'
42 - id: VwSnzv10lZ
43 formula: '[TRIP/Bike Id]'
44 - id: pxvj425aDk
45 formula: '[TRIP/Subscription Type]'
46 - id: HZOjVcwDG1
47 formula: '[TRIP/Zip Code]'
48 order:
49 - VGGdL5h1XL
50 - XfekGVjpYe
51 - vSNXcQlbgo
52 - n0viQISda6
53 - otGGHmPqJZ
54 - jrQpKNxZxF
55 - xT5p03z0yD
56 - kctIxpAAqM
57 - VwSnzv10lZ
58 - pxvj425aDk
59 - HZOjVcwDG1
60 - id: LBMxXnUDCS
61 kind: bar-chart
62 source:
63 elementId: ammWveJOET
64 kind: table
65 columns:
66 - id: xwi1BMJ3PL
67 formula: '[TRIP/Start Station Name]'
68 - id: vKP79P5tMl
69 formula: Count([Id])
70 - id: HlVOO3VkmU
71 formula: '[TRIP/Subscription Type]'
72 - id: 7vIMaF82Ea
73 formula: '[TRIP/Id]'
74 - id: OaVsOl70Mu
75 formula: '[TRIP/Duration]'
76 - id: 2EupEbY2C1
77 formula: '[TRIP/Start Date]'
78 - id: cOt55IxOwt
79 formula: '[TRIP/Start Station Id]'
80 - id: pOeY8EgDKh
81 formula: '[TRIP/End Date]'
82 - id: YvYBibU28Y
83 formula: '[TRIP/End Station Name]'
84 - id: W8iYZkmMus
85 formula: '[TRIP/End Station Id]'
86 - id: 9xgXlflRhB
87 formula: '[TRIP/Bike Id]'
88 - id: eBbsizX2wU
89 formula: '[TRIP/Zip Code]'
90 yAxis:
91 - id: vKP79P5tMl
92 xAxis:
93 id: xwi1BMJ3PL
94 sort:
95 by: vKP79P5tMl
96 direction: descending
97 pages:
98 - id: QKIgFmOpQt
99 name: Page 1
100 layout: |
101 <?xml version="1.0" encoding="utf-8"?>
102 <Page type="grid" gridTemplateColumns="repeat(24, 1fr)" gridTemplateRows="auto" id="QKIgFmOpQt">
103 <Element elementId="ammWveJOET" gridColumn="1 / 25" gridRow="1 / 21"/>
104 <Element elementId="LBMxXnUDCS" gridColumn="1 / 25" gridRow="21 / 41"/>
105 </Page>

Representing layout

In this example representation, the layout for Page 1 is defined in the layout field.

1layout: |
2 <?xml version="1.0" encoding="utf-8"?>
3 <Page type="grid" gridTemplateColumns="repeat(24, 1fr)" gridTemplateRows="auto" id="QKIgFmOpQt">
4 <Element elementId="ammWveJOET" gridColumn="1 / 25" gridRow="1 / 21"/>
5 <Element elementId="LBMxXnUDCS" gridColumn="1 / 25" gridRow="21 / 41"/>
6 </Page>

The layout field contains one <Page> element per workbook page. The id attribute of <Page> must match the id of the corresponding page in the document.pages array. Inside <Page>, each <Element> entry places one element on that page — the elementId attribute must match the id of the corresponding element in the document.elements array.

The gridColumn attribute controls the horizontal position and width of an element. The grid is 1-indexed across 24 columns, where 1 is the left edge and 25 is the right edge. For example, "1 / 25" spans the full width, "1 / 13" spans the left half, and "13 / 25" spans the right half.

The gridRow attribute controls the vertical position and height of an element. In this example, "1 / 21" places the table at the top of the page and "21 / 41" places the bar chart directly below it.

Layout tags

The layout field supports the following tags:

TagDescription
<Page>One workbook page. The id attribute must match the id of a page in document.pages. A modal is also represented as a <Page>, whose id matches an entry in document.overlays.
<Element>One element placed on a page, in a container, or in a tab. The elementId attribute must match the id of an element in document.elements.
<Container>A container element. The elementId attribute must match the id of a container element in document.elements. Nest an <Element> for each element inside the container.
<TabbedContainer>A tabbed container element. The elementId attribute must match the id of a tabbed-container element in document.elements. Nest one <Tab> per tab.
<Tab>One tab inside a <TabbedContainer>. Nest an <Element> for each element in that tab. Tab order in the layout matches the order of the tabs array on the tabbed container element.

The following example places a table and a pivot table inside a container:

1layout: |
2 <?xml version="1.0" encoding="utf-8"?>
3 <Page type="grid" gridTemplateColumns="repeat(24, 1fr)" gridTemplateRows="auto" id="QKIgFmOpQt">
4 <Container elementId="B9DoZzOllO" type="grid" gridColumn="1 / 25" gridRow="1 / 41" gridTemplateColumns="repeat(24, 1fr)" gridTemplateRows="auto">
5 <Element elementId="QBzbVN4mCL" gridColumn="1 / 25" gridRow="1 / 21"/>
6 <Element elementId="1CFkfKbYWo" gridColumn="1 / 25" gridRow="21 / 41"/>
7 </Container>
8 </Page>

The container and both nested elements are siblings in the flat document.elements array; only the layout expresses that the table and pivot table sit inside the container.