Wicked Smart Data
LearnInsightsAboutContact
Sign InLet's Build
LearnInsightsAboutContact
Sign InLet's Build
Wicked Smart Data

Intelligence, automation, and expert execution — plus an elite library of free knowledge. We turn complexity into competitive advantage.

Start a conversation

Platform

  • Learning Paths
  • Insights
  • RSS Feed

Company

  • About
  • Contact
  • Work With Us

Legal

  • Privacy Policy
  • Terms of Service

© 2026 Wicked Smart Data. All rights reserved.

Intelligence · Automation · Advantage

All Insights
Power Apps

Configuring Model-Driven App Form XML Customizations: Directly Editing formXml to Control Tab Order, Column Spanning, and Component Positioning Beyond the Visual Designer

The Power Apps form designer gets you most of the way there — but for precise column spans, workflow-driven tab order, and component positioning that survives deployment, you need to edit formXml directly. This deep-dive lesson teaches you the full schema, hands-on editing workflows, and the validation discipline that keeps complex forms stable across environments.

🔥 Expert28 min readNov 20, 2026Updated Nov 20, 2026
Configuring Model-Driven App Form XML Customizations: Directly Editing formXml to Control Tab Order, Column Spanning, and Component Positioning Beyond the Visual Designer
On this page
  • Introduction
  • Prerequisites
  • Understanding What formXml Actually Is
  • Extracting formXml for Editing
  • Method 1: Export and Unpack a Solution
  • Method 2: Retrieve via Web API
  • Method 3: The customizations.xml Route
  • Controlling Column Span: The colspan Attribute in Depth
  • The Section Column Grid Model
  • Three-Column Sections and Mixed Spans
  • Spacer Cells
  • Controlling Tab Order
  • How the Default Tab Order Works
  • The tabindex Attribute on Controls
  • Practical Example: Call Center Form Tab Order
  • Tab Order Across Sections and Tabs
  • Component Positioning: PCF Controls, Subgrids, and Quick Views
  • PCF Control Syntax in formXml
  • Subgrid Positioning
  • Quick View Forms Embedded in formXml
  • Working with the DesktopLayout and MobileLayout Elements
  • The FormPresenter and Tab Visibility
  • Cell IDs and Uniqueness: A Pitfall You Will Hit
  • Validating Your formXml Before Import
  • Schema Validation
  • Manual Checks Before Import
  • Hands-On Exercise: Restructuring a Procurement Request Form
  • Common Mistakes & Troubleshooting
  • "The form loaded but my column spans are ignored"
  • "The form designer can't open my form anymore"
  • "Import succeeds but Publish All Customizations fails"
  • "My tab order changes are ignored in the app"
  • "I edited the XML and now the designer shows a different layout than what loads at runtime"
  • Keeping XML Customizations Alive in Solutions
  • Advanced Pattern: Injecting Controls That the Designer Can't Place
  • Summary & Next Steps

Configuring Model-Driven App Form XML Customizations: Directly Editing formXml to Control Tab Order, Column Spanning, and Component Positioning Beyond the Visual Designer

Introduction

You've probably hit the wall. You're building a complex model-driven app form — maybe a detailed case management screen, an intricate opportunity form with custom PCF controls, or a heavily branded employee onboarding record. The visual form designer in Power Apps Studio gets you 85% of the way there. Then you try to make a field span three columns, or you discover that your tab order is inexplicably wrong for keyboard-navigating users, or you need a spacer column that only exists on one side of a two-column section. The designer just won't do it. You drag, you drop, you click Save, and the layout snaps back to something you didn't ask for.

This is the moment when understanding the underlying formXml stops being a nice-to-have and becomes a professional necessity. The XML that defines model-driven app forms is not some opaque internal format — it's a readable, editable, well-structured schema that you can manipulate directly. When you do, you unlock layout control that the visual designer never exposes: precise column span values, section-level row configurations, explicit tab order sequences, and component positioning that survives deployment across environments. The designer is a tool for 80% of work. This article is about the other 20%.

By the end of this lesson you will have worked through realistic form XML scenarios, understood the schema well enough to debug and extend it confidently, and you'll know exactly when and how to reach past the designer without breaking your solutions or your users.

What you'll learn:

  • The structure of formXml and how it maps to what users see on a form
  • How to extract, edit, and re-import form XML through solutions and the Dataverse Web API
  • Controlling column span with the colspan attribute and understanding how it interacts with section column counts
  • Setting explicit tab order sequences using tabindex and DesktopLayout ordering
  • Positioning spacers, empty cells, and PCF components in locations the designer cannot reach
  • Validating and troubleshooting form XML without breaking production forms

Prerequisites

Before diving in, you should be comfortable with the following:

  • Building and publishing model-driven app forms using the standard form designer — if you need a refresher on how tabs, sections, and columns fit together visually, Designing Model-Driven Forms: Sections, Tabs, Subgrids, and Quick View Forms covers all of that groundwork.
  • Understanding the solution system: how to export, unpack, and import solutions. We'll rely heavily on this workflow. Solutions for Model-Driven Apps: Publishers, Managed vs Unmanaged, and Solution Layering has the full picture.
  • Basic XML editing — you don't need to be an XML schema expert, but you need to be comfortable reading attribute-value pairs and nesting without getting lost.
  • Some exposure to the Dataverse Web API is helpful but not strictly required.

Understanding What formXml Actually Is

When you design a form in Power Apps Studio, every drag-and-drop action is writing XML behind the scenes. That XML is stored as a property on the systemform entity (table) in Dataverse. The column is literally called formxml — a single nvarchar(max) field containing the entire layout definition as an XML document.

This is worth internalizing: the form designer is a GUI wrapper around XML editing. Every limitation of the designer is ultimately a limitation of what operations the GUI exposes, not a limitation of the underlying format. The XML can express things the GUI never shows you a button for.

Here's a simplified skeleton of a formXml document to anchor the conversation:

<form>
  <tabs>
    <tab name="tab_summary" id="{a1b2c3d4-...}" label="Summary" expanded="true">
      <columns>
        <column width="100%">
          <sections>
            <section name="section_identity" showlabel="false" columns="2">
              <rows>
                <row>
                  <cell colspan="1" rowspan="1" id="{...}" showlabel="true" locklevel="0">
                    <labels>
                      <label description="Full Name" languagecode="1033" />
                    </labels>
                    <control id="fullname" classid="{...}" datafieldname="fullname" disabled="false" />
                  </cell>
                  <cell colspan="1" rowspan="1" id="{...}" showlabel="true" locklevel="0">
                    <labels>
                      <label description="Account" languagecode="1033" />
                    </labels>
                    <control id="parentcustomerid" classid="{...}" datafieldname="parentcustomerid" disabled="false" />
                  </cell>
                </row>
              </rows>
            </section>
          </sections>
        </column>
      </columns>
    </tab>
  </tabs>
  <events />
  <DisplayConditions />
  <Liner />
  <RibbonBar />
</form>

Notice the hierarchy: form → tabs → tab → columns → column → sections → section → rows → row → cell → control. Every control you place on a form lives inside a cell, inside a row, inside a section. Understanding this hierarchy is the entire foundation of everything that follows.

Key insight

The section element has a columns attribute that defines how many columns the section grid has — typically 1, 2, or 3. A cell's colspan attribute is relative to this grid. If section columns="2" and a cell has colspan="2", that cell spans the full width of the section. If section columns="3" and a cell has colspan="2", it spans two-thirds of the section width.


Extracting formXml for Editing

There are three reliable ways to get the XML out in a form you can actually edit. Each has tradeoffs.

Method 1: Export and Unpack a Solution

This is the most reliable, source-control-friendly approach and the one you should use in professional projects.

  1. In Power Apps (make.powerapps.com), navigate to Solutions and open the unmanaged solution containing your form.
  2. Export the solution as Unmanaged (not Managed — you need to be able to re-import it as unmanaged in dev).
  3. Unzip the exported .zip file. You'll find a folder structure like this:
MySolution/
  [Content_Types].xml
  customizations.xml
  solution.xml
  Other/
  Entities/
    new_incidentreport/
      FormXml/
        main/
          {formid}.xml
  1. The form XML lives at Entities/{tablename}/FormXml/main/{formid}.xml (or quick, card, etc. for other form types).
  2. Open that file in VS Code (with an XML extension for validation) and edit directly.
  3. Re-zip the solution folder maintaining the same directory structure.
  4. Import the modified solution back into your environment.

Warning

When re-zipping, make sure you're zipping the contents of the solution folder, not the folder itself. The solution.xml and customizations.xml files must be at the root of the zip, not inside a subfolder. Getting this wrong produces cryptic import errors that have nothing to do with your XML changes.

Method 2: Retrieve via Web API

For surgical edits where you don't want to deal with full solution exports, you can retrieve and update the formxml field directly via the Web API.

First, find your form's ID. In the form designer URL, the GUID after formid= is what you need. Then:

GET [org_url]/api/data/v9.2/systemforms({formid})?$select=formxml
Accept: application/json
OData-MaxVersion: 4.0
OData-Version: 4.0

You'll get back a JSON response where formxml is a string containing your XML (HTML-entity-encoded). Extract that value, decode any &lt; / &gt; entities, format it nicely in your editor, make your changes, then PUT it back:

PATCH [org_url]/api/data/v9.2/systemforms({formid})
Content-Type: application/json

{
  "formxml": "<form>...your modified xml here...</form>"
}

After patching, publish the form:

POST [org_url]/api/data/v9.2/PublishXml
Content-Type: application/json

{
  "ParameterXml": "<importexportxml><entities><entity>new_incidentreport</entity></entities></importexportxml>"
}

Tip

Use Postman or the VS Code REST Client extension with a .http file for this workflow. Store your org URL and form GUIDs as variables so you can run the retrieve → edit → patch cycle quickly during iteration.

Method 3: The customizations.xml Route

When you export a solution, customizations.xml is an aggregated file containing all customizations, including all form XMLs for all tables in that solution. For large solutions, it's unwieldy — the file can be hundreds of thousands of lines long. Use the per-entity FormXml files from the unpacked solution instead. The customizations.xml approach is only practical if you're using the Solution Packager CLI tool, which is exactly the kind of professional setup you should be using anyway.


Controlling Column Span: The colspan Attribute in Depth

This is probably the most common reason people reach for form XML directly. Let's work through it properly.

The Section Column Grid Model

A section defines a grid. The columns attribute on <section> can be 1, 2, or 3. Inside that grid, each <row> contains <cell> elements, and each cell has a colspan attribute indicating how many grid columns it occupies.

The constraint is simple but easy to violate: the sum of colspan values in any row must not exceed the section's column count. If it does, the form renderer either ignores the extra span or wraps unexpectedly.

For a concrete example, let's say you're building an incident report form. You have a section for "Incident Details" that you want to lay out like this:

  • Row 1: Incident Title spanning full width (2 columns)
  • Row 2: Category (1 col) | Severity (1 col)
  • Row 3: Description spanning full width (2 columns)
  • Row 4: Assigned To (1 col) | Due Date (1 col)

The designer might let you get rows 2 and 4 right, but getting that title and description to span the full two columns reliably requires XML:

<section name="section_incident_details" showlabel="true" columns="2" locklevel="0">
  <labels>
    <label description="Incident Details" languagecode="1033" />
  </labels>
  <rows>
    <!-- Full-width title -->
    <row>
      <cell colspan="2" rowspan="1" id="{cell-01}" showlabel="true">
        <labels>
          <label description="Incident Title" languagecode="1033" />
        </labels>
        <control id="new_incidenttitle" classid="{4273EDBD-...}" datafieldname="new_incidenttitle" disabled="false" />
      </cell>
    </row>
    <!-- Two-column row -->
    <row>
      <cell colspan="1" rowspan="1" id="{cell-02}" showlabel="true">
        <labels>
          <label description="Category" languagecode="1033" />
        </labels>
        <control id="new_category" classid="{3EF39988-...}" datafieldname="new_category" disabled="false" />
      </cell>
      <cell colspan="1" rowspan="1" id="{cell-03}" showlabel="true">
        <labels>
          <label description="Severity" languagecode="1033" />
        </labels>
        <control id="new_severity" classid="{3EF39988-...}" datafieldname="new_severity" disabled="false" />
      </cell>
    </row>
    <!-- Full-width description -->
    <row>
      <cell colspan="2" rowspan="1" id="{cell-04}" showlabel="true">
        <labels>
          <label description="Description" languagecode="1033" />
        </labels>
        <control id="new_description" classid="{E0DECE4B-...}" datafieldname="new_description" disabled="false" />
      </cell>
    </row>
    <!-- Two-column row -->
    <row>
      <cell colspan="1" rowspan="1" id="{cell-05}" showlabel="true">
        <labels>
          <label description="Assigned To" languagecode="1033" />
        </labels>
        <control id="ownerid" classid="{270BD3DB-...}" datafieldname="ownerid" disabled="false" />
      </cell>
      <cell colspan="1" rowspan="1" id="{cell-06}" showlabel="true">
        <labels>
          <label description="Due Date" languagecode="1033" />
        </labels>
        <control id="new_duedate" classid="{5B773807-...}" datafieldname="new_duedate" disabled="false" />
      </cell>
    </row>
  </rows>
</section>

Notice that the full-width rows only contain one <cell> element — the single cell has colspan="2" so it occupies both grid columns. You don't add a second empty cell to fill the row.

Three-Column Sections and Mixed Spans

Three-column sections unlock more sophisticated layouts but add complexity. Here's a scenario: a financial services company wants their deal form to show Deal Name full-width, then three equal metric fields (Pipeline Value, Close Probability, Weighted Value) in a row, then a two-thirds/one-third split for the description and a quick status indicator.

<section name="section_deal_metrics" showlabel="false" columns="3" locklevel="0">
  <rows>
    <!-- Full-width deal name -->
    <row>
      <cell colspan="3" rowspan="1" id="{cell-dm-01}" showlabel="true">
        <labels>
          <label description="Deal Name" languagecode="1033" />
        </labels>
        <control id="new_dealname" classid="{4273EDBD-...}" datafieldname="new_dealname" disabled="false" />
      </cell>
    </row>
    <!-- Three equal columns -->
    <row>
      <cell colspan="1" rowspan="1" id="{cell-dm-02}" showlabel="true">
        <labels><label description="Pipeline Value" languagecode="1033" /></labels>
        <control id="new_pipelinevalue" classid="{533B9E00-...}" datafieldname="new_pipelinevalue" disabled="false" />
      </cell>
      <cell colspan="1" rowspan="1" id="{cell-dm-03}" showlabel="true">
        <labels><label description="Close Probability" languagecode="1033" /></labels>
        <control id="new_closeprobability" classid="{533B9E00-...}" datafieldname="new_closeprobability" disabled="false" />
      </cell>
      <cell colspan="1" rowspan="1" id="{cell-dm-04}" showlabel="true">
        <labels><label description="Weighted Value" languagecode="1033" /></labels>
        <control id="new_weightedvalue" classid="{533B9E00-...}" datafieldname="new_weightedvalue" disabled="false" />
      </cell>
    </row>
    <!-- 2/3 + 1/3 split -->
    <row>
      <cell colspan="2" rowspan="1" id="{cell-dm-05}" showlabel="true">
        <labels><label description="Deal Summary" languagecode="1033" /></labels>
        <control id="new_dealsummary" classid="{E0DECE4B-...}" datafieldname="new_dealsummary" disabled="false" />
      </cell>
      <cell colspan="1" rowspan="1" id="{cell-dm-06}" showlabel="true">
        <labels><label description="Status" languagecode="1033" /></labels>
        <control id="statuscode" classid="{3EF39988-...}" datafieldname="statuscode" disabled="false" />
      </cell>
    </row>
  </rows>
</section>

Key insight

The classid GUIDs on control elements identify the control type (text input, lookup, optionset, etc.). You don't guess these — you copy them from existing controls in your form XML. The designer always generates them correctly when you first add a field. If you're duplicating a row or cell, copy the whole <control> element and change only id, datafieldname, and the cell's id attribute.

Spacer Cells

Sometimes you want a field on the right side of a row with nothing on the left. The designer typically forces you to put something in the left slot, or it fills it with an invisible placeholder. In XML, you create an explicit spacer cell:

<row>
  <cell colspan="1" rowspan="1" id="{cell-spacer-01}" showlabel="false">
    <!-- Empty cell - renders as blank space -->
  </cell>
  <cell colspan="1" rowspan="1" id="{cell-07}" showlabel="true">
    <labels><label description="Approval Status" languagecode="1033" /></labels>
    <control id="new_approvalstatus" classid="{3EF39988-...}" datafieldname="new_approvalstatus" disabled="false" />
  </cell>
</row>

An empty <cell> with no <control> child renders as blank space. This is simple but powerful — the visual designer has no clean way to express "I deliberately want nothing here."


Controlling Tab Order

Tab order — the sequence in which keyboard focus moves through form fields when the user presses Tab — is one of the most accessibility-critical and least designer-controllable aspects of model-driven forms.

How the Default Tab Order Works

By default, the tab sequence follows the XML document order: top-to-bottom within a section, left-to-right within a row, section by section, tab by tab. If your visual layout matches that document order, default tab behavior is usually fine. But when you've rearranged elements, used column spans, or placed controls in a non-linear visual order, the actual keyboard tab path can become confusing or inaccessible.

The tabindex Attribute on Controls

Individual <control> elements accept a tabindex attribute. This integer determines the tab sequence within the form:

<control id="new_firstname" classid="{...}" datafieldname="new_firstname" 
         disabled="false" tabindex="1" />

The rules work like standard HTML tabindex:

  • Controls with tabindex="0" follow document order among themselves.
  • Controls with tabindex > 0 are visited in ascending numeric order before tabindex="0" controls.
  • Controls with tabindex="-1" are excluded from tab order entirely (useful for display-only or auto-calculated fields).

Warning

Setting explicit tabindex values means you own the entire sequence. If you set tabindex on some controls but not others, browsers may produce unexpected order at the boundary between explicit and default-ordered controls. If you're using tabindex, audit and set it on every interactive control in the form. The tabindex="-1" trick is particularly useful for formula columns and rollup columns that display computed values users shouldn't be tabbing into.

Practical Example: Call Center Form Tab Order

Imagine a call center agent form for logging inbound cases. The visual layout has two sections side by side (via a tab with two section columns), but the natural workflow order doesn't match the left-right visual order. The agent should tab through: Caller Name → Phone Number → Account → Category → Description → Priority → Assigned Team. That's a cross-column path.

In the XML:

<!-- Left column, row 1 -->
<control id="new_callername" classid="{4273EDBD-...}" datafieldname="new_callername" 
         disabled="false" tabindex="1" />

<!-- Right column, row 1 -->
<control id="new_phonenumber" classid="{4273EDBD-...}" datafieldname="new_phonenumber" 
         disabled="false" tabindex="2" />

<!-- Left column, row 2 -->
<control id="new_account" classid="{270BD3DB-...}" datafieldname="accountid" 
         disabled="false" tabindex="3" />

<!-- Right column, row 2 (Category is visually on the right but logically comes after Account) -->
<control id="new_category" classid="{3EF39988-...}" datafieldname="new_category" 
         disabled="false" tabindex="4" />

<!-- Description spans full width, row 3 -->
<control id="new_description" classid="{E0DECE4B-...}" datafieldname="new_description" 
         disabled="false" tabindex="5" />

<!-- Priority - left col, row 4 -->
<control id="new_priority" classid="{3EF39988-...}" datafieldname="new_priority" 
         disabled="false" tabindex="6" />

<!-- Assigned Team - right col, row 4 -->
<control id="owningteam" classid="{270BD3DB-...}" datafieldname="owningteam" 
         disabled="false" tabindex="7" />

The visual layout places these in a grid, but the tabindex values create a logical keyboard path that follows the agent's actual workflow rather than the visual column order.

Tab Order Across Sections and Tabs

The form-level tab element controls the order of sections on a tab, and the tab element itself defines which tab gets keyboard focus first. By default, tabs are ordered by their position in the XML. You can influence section-level ordering by resequencing <section> elements within the XML — the designer cannot freely drag sections across the tab XML structure.

Tabs themselves have an expanded attribute. Only expanded tabs are immediately visible, and keyboard focus follows the visual order of expanded sections before collapsing to contracted ones.


Component Positioning: PCF Controls, Subgrids, and Quick Views

If you're working with PCF (Power Component Framework) controls or complex components like subgrids and quick view forms, the XML for those controls differs from simple field controls and the designer sometimes places them in unexpected positions.

PCF Control Syntax in formXml

A PCF control bound to a field has this structure:

<cell colspan="2" rowspan="1" id="{cell-pcf-01}" showlabel="false">
  <labels>
    <label description="Risk Heatmap" languagecode="1033" />
  </labels>
  <control id="new_riskscore" classid="{F9A8A302-...}" datafieldname="new_riskscore" disabled="false">
    <parameters>
      <MaxValue>100</MaxValue>
      <MinValue>0</MinValue>
      <ShowLabels>true</ShowLabels>
    </parameters>
  </control>
</cell>

The classid for a PCF control is not the standard field type GUID — it's the component's unique identifier registered in the Dataverse solution. You find this by first adding the PCF control to any field via the designer, saving, then exporting the XML to see what classid was assigned.

The <parameters> child is where PCF input properties are configured. These map directly to the properties defined in the component's manifest. The designer exposes a simplified configuration pane for these, but you can set values there that the pane might not let you express directly — for example, binding a parameter to an expression rather than a literal value (in some configurations).

Subgrid Positioning

Subgrids are notoriously difficult to position precisely in the designer. In XML, a subgrid is a control with no datafieldname and a specific classid:

<cell colspan="3" rowspan="5" id="{cell-subgrid-01}" showlabel="true">
  <labels>
    <label description="Related Line Items" languagecode="1033" />
  </labels>
  <control id="subgrid_lineitems" classid="{E7A81278-8635-4d9e-8D4D-59480B391C5B}" 
           disabled="false" uniqueid="{...}">
    <parameters>
      <TargetEntityType>new_lineitem</TargetEntityType>
      <RelationshipName>new_incidentreport_lineitem</RelationshipName>
      <AutoExpand>Auto</AutoExpand>
      <EnableQuickCreate>true</EnableQuickCreate>
      <ViewId>{view-guid-here}</ViewId>
      <ViewIds>{view-guid-here}</ViewIds>
    </parameters>
  </control>
</cell>

The rowspan attribute on the cell is what controls how many grid rows the subgrid occupies vertically. This is completely invisible in the designer but critical for making subgrids look right in complex multi-section layouts. Setting rowspan="5" on a section with columns="3" means the subgrid occupies a 3-wide, 5-tall area.

Note

rowspan is respected for height allocation in the layout engine, but the actual visible height of a subgrid is also influenced by its own auto-expand setting and the number of records. Setting a large rowspan gives the subgrid room to expand without pushing other content around, but it doesn't pin the height absolutely.

Quick View Forms Embedded in formXml

Quick view forms embedded in a main form also appear as controls in the XML:

<control id="quickViewControl_account" 
         classid="{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" 
         disabled="false">
  <parameters>
    <LookupFieldName>accountid</LookupFieldName>
    <LookupFieldAttributeLogicalName>accountid</LookupFieldAttributeLogicalName>
    <LookupEntityType>account</LookupEntityType>
    <ViewId>{quickformid-guid}</ViewId>
  </parameters>
</control>

Placing this control precisely — say, in the right column of a three-column section with a colspan of 1 — gives you summary data from the related account positioned exactly where the form design calls for it, something the designer's drag targets often can't nail down.


Working with the DesktopLayout and MobileLayout Elements

Forms in modern model-driven apps can have both a desktop layout and a mobile layout. These are controlled by optional <DesktopLayout> and <MobileLayout> elements within the form XML. When these elements are absent, the form uses the same layout for both surfaces.

For most enterprise forms, you want explicit control over how the form reflows on mobile. The <DesktopLayout> section mirrors the main <tabs> structure but with layout hints specific to desktop rendering, particularly around column widths. The <MobileLayout> section allows you to present a simplified, single-column version:

<MobileLayout>
  <sections>
    <section name="mobile_primary" columns="1">
      <rows>
        <row>
          <cell colspan="1">
            <control id="new_incidenttitle" classid="{4273EDBD-...}" datafieldname="new_incidenttitle" />
          </cell>
        </row>
        <row>
          <cell colspan="1">
            <control id="new_category" classid="{3EF39988-...}" datafieldname="new_category" />
          </cell>
        </row>
        <!-- Continue with priority fields only - hide verbose description on mobile -->
      </rows>
    </section>
  </sections>
</MobileLayout>

This approach gives you a genuinely different field order and field selection for mobile users without maintaining two entirely separate form definitions.


The FormPresenter and Tab Visibility

Tabs in formXml support conditional visibility through the available attribute, but more sophisticated control comes through the form's <DisplayConditions> element and through JavaScript form logic. What many people don't realize is that the sequence of tabs in the XML directly controls the default active tab when the form loads.

<tabs>
  <!-- This tab will be active by default when the form loads -->
  <tab name="tab_summary" id="{tab-01}" label="Summary" expanded="true" visible="true">
    ...
  </tab>
  <tab name="tab_details" id="{tab-02}" label="Details" expanded="true" visible="true">
    ...
  </tab>
  <tab name="tab_history" id="{tab-03}" label="History" expanded="false" visible="true">
    ...
  </tab>
</tabs>

The first tab in document order gets focus. Swapping tabs in the XML changes which tab opens first — something you might need to do if you want the form to open on a "Status" tab for approvers but the "Details" tab is currently first because it was built first.

Tip

If you're building role-based form experiences — where different user roles see different default tabs — you can maintain one form with JavaScript that sets active tab on load, but you can also create two separate form definitions (via solution components) with different tab orderings for different security roles. This avoids JavaScript complexity for a purely presentational difference. See Model-Driven App Security: Configuring Security Roles, Field Permissions, and Team-Based Access for Table Data for how form assignment by security role works.


Cell IDs and Uniqueness: A Pitfall You Will Hit

Every <cell> element in a formXml must have a unique id attribute, and that ID must be a GUID. When you copy rows or cells from one part of the form to another (which you'll do regularly), you must generate new GUIDs for every duplicated cell.

Failing to do this produces one of several silent failures:

  • The form loads but one of the duplicate-ID cells is ignored entirely.
  • The form designer becomes unable to open the form for visual editing.
  • Import succeeds but publish fails with a vague validation error.

For generating GUIDs in bulk, use PowerShell:

# Generate 10 GUIDs for new cell IDs
1..10 | ForEach-Object { [System.Guid]::NewGuid().ToString().ToUpper() }

Or in the VS Code terminal with a guid-generator extension. The convention in formXml is to wrap GUIDs in curly braces: {A1B2C3D4-...}. Keep that format consistent.

Warning

Control id attributes must be unique within the form but are more flexible than cell IDs — they're often the same as the datafieldname for simple fields, but for forms with the same field appearing multiple times (unusual but valid in some read-only display scenarios), each occurrence needs a distinct control id.


Validating Your formXml Before Import

Submitting invalid XML to Dataverse can break your form in ways that are painful to recover from. Build a validation habit.

Schema Validation

Microsoft publishes the form XML schema (XSD) in the SDK documentation. While the full XSD isn't always current, you can download it from the Dataverse SDK NuGet package and load it in VS Code for inline validation:

  1. Install the VS Code "XML" extension by Red Hat.
  2. Add a schema reference at the top of your XML file:
    <?xml version="1.0" encoding="utf-8"?>
    <form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    
  3. The extension will flag unknown attributes and missing required children inline.

Manual Checks Before Import

Run through this checklist mentally before every import:

  • All GUIDs in id attributes are unique across the entire file
  • Every cell's colspan doesn't exceed the parent section's columns count
  • The sum of colspans in every row doesn't exceed the section columns count
  • Every <control> has a valid classid (copied from an existing control, not invented)
  • Every <control> with a datafieldname references a column that actually exists on the table
  • No XML encoding issues (use &amp; not &, etc.)

Hands-On Exercise: Restructuring a Procurement Request Form

Let's work through a complete scenario. You have a procurement request form with this current (messy) layout from the designer:

  • Tab 1: General Info

    • Section 1 (2 columns): Request Title | Request Date
    • Section 2 (2 columns): Vendor | Amount | Category (this doesn't work visually because there are 3 fields in a 2-column section — the designer put Category on a new row, left-aligned, with an ugly blank right cell)
    • Section 3 (1 column): Justification (spanning full width fine)
  • Tab 2: Approval

    • Section 1 (2 columns): Approved By | Approval Date | Status (same problem as above)

Your goal is to fix the layout so Vendor and Amount are on row 1, Category and Status are on row 2 (yes, pulling Status from Tab 2 up to Tab 1 for quick visibility), and Justification spans full width on row 3.

Step 1: Export the solution and open the form XML file.

Step 2: Locate the General Info section. It currently looks like this (after the designer's choices):

<section name="section_vendorinfo" columns="2">
  <rows>
    <row>
      <cell colspan="1" id="{A1}">
        <control id="new_vendor" datafieldname="new_vendor" classid="{270BD3DB-...}" />
      </cell>
      <cell colspan="1" id="{A2}">
        <control id="new_amount" datafieldname="new_amount" classid="{533B9E00-...}" />
      </cell>
    </row>
    <row>
      <cell colspan="1" id="{A3}">
        <control id="new_category" datafieldname="new_category" classid="{3EF39988-...}" />
      </cell>
      <cell colspan="1" id="{A4}">
        <!-- Empty cell the designer placed here -->
      </cell>
    </row>
  </rows>
</section>

Step 3: Modify to add Status (from Tab 2) on row 2, right column. First, copy the Status control definition from Tab 2's section:

<!-- Original in Tab 2 -->
<control id="new_approvalstatus" datafieldname="new_approvalstatus" classid="{3EF39988-...}" disabled="false" />

Step 4: Edit section_vendorinfo to place it:

<section name="section_vendorinfo" showlabel="false" columns="2" locklevel="0">
  <rows>
    <row>
      <cell colspan="1" rowspan="1" id="{A1}" showlabel="true">
        <labels><label description="Vendor" languagecode="1033" /></labels>
        <control id="new_vendor" datafieldname="new_vendor" classid="{270BD3DB-...}" disabled="false" />
      </cell>
      <cell colspan="1" rowspan="1" id="{A2}" showlabel="true">
        <labels><label description="Amount" languagecode="1033" /></labels>
        <control id="new_amount" datafieldname="new_amount" classid="{533B9E00-...}" disabled="false" />
      </cell>
    </row>
    <row>
      <cell colspan="1" rowspan="1" id="{A3}" showlabel="true">
        <labels><label description="Category" languagecode="1033" /></labels>
        <control id="new_category" datafieldname="new_category" classid="{3EF39988-...}" disabled="false" />
      </cell>
      <cell colspan="1" rowspan="1" id="{NEW-GUID-01}" showlabel="true">
        <labels><label description="Approval Status" languagecode="1033" /></labels>
        <control id="new_approvalstatus_summary" datafieldname="new_approvalstatus" classid="{3EF39988-...}" disabled="true" tabindex="-1" />
      </cell>
    </row>
    <row>
      <cell colspan="2" rowspan="1" id="{A5}" showlabel="true">
        <labels><label description="Justification" languagecode="1033" /></labels>
        <control id="new_justification" datafieldname="new_justification" classid="{E0DECE4B-...}" disabled="false" />
      </cell>
    </row>
  </rows>
</section>

Notice a few things: The status control on Tab 1 uses a different id (new_approvalstatus_summary) from the one on Tab 2, is set to disabled="true" (read-only display), and has tabindex="-1" to exclude it from the keyboard tab sequence since it's informational only.

Step 5: Remove the status control from Tab 2's section now that it's displayed on Tab 1. (Or leave it in Tab 2 as the editable version — having the same field on two tabs is a valid pattern when Tab 1 shows it read-only as a summary.)

Step 6: Re-zip and import the solution. After import, navigate to Solutions → Publish All Customizations. Open the form to verify.


Common Mistakes & Troubleshooting

"The form loaded but my column spans are ignored"

The most common cause: your section's columns attribute doesn't match what you think it is. Check the <section columns="..."> attribute directly — the designer sometimes changes it when you open and save the form. Also check that you haven't set colspan greater than the section's column count.

"The form designer can't open my form anymore"

You have an XML error. The most likely culprits are: a duplicate cell ID, a malformed GUID (missing braces, wrong length), or a control classid that doesn't match any registered control in that environment (can happen if you copy XML between environments where PCF components aren't deployed). To recover, retrieve the last-working formxml via the Web API (from an environment where it works), identify what changed, and fix it.

"Import succeeds but Publish All Customizations fails"

Dataverse validates the form XML during publish, not during import. Publish validation checks referential integrity: does every datafieldname correspond to a real column on the table? Does every subgrid RelationshipName correspond to a real relationship? Fix by checking every datafieldname and relationship reference.

"My tab order changes are ignored in the app"

Browser focus management and Unified Interface's own accessibility layer can override explicit tabindex in some versions. If tabindex on controls isn't working as expected, check whether you're on the latest Unified Interface release notes for any known tabindex handling issues. Also, some controls (lookups, optionsets) have their own internal focus management that the outer tabindex can't fully control — test with simple text inputs first to confirm the mechanism works, then iterate on complex control types.

"I edited the XML and now the designer shows a different layout than what loads at runtime"

You've probably edited the formxml column of systemform directly (via API) but the form cache in your browser and the designer's internal representation haven't refreshed. Clear browser cache, do a hard reload, and verify via the designer's read-only preview first. If the designer shows something different from what the runtime app renders, the runtime is probably using a cached version. Publish All Customizations again and wait a few minutes.

Tip

When iterating on form XML in development, use the Web API PATCH approach (Method 2 above) followed by a targeted publish. It's much faster than the full solution export → edit → import cycle, which you reserve for changes you're committing to source control.


Keeping XML Customizations Alive in Solutions

One of the most important things to understand about formXml customizations is their relationship to the solution layering system. When you export a form as part of an unmanaged solution and import it into a downstream environment, the entire formxml value is replaced — your XML layout becomes the definitive version.

When you export as a managed solution, the managed layer's formXml takes precedence over any unmanaged customizations in the downstream environment unless the customizability is explicitly allowed. This is worth understanding deeply: if your managed solution locks the form, downstream admins can't use the visual designer to rearrange it — which might be exactly what you want for an ISV product, or a serious problem for a client customization scenario.

For enterprise deployment patterns, the right approach is:

  1. Keep your authoritative form XML in source control (the unpacked solution folder checked into Git).
  2. Use the Solution Packager CLI in your CI/CD pipeline to pack and import.
  3. Never directly edit formXml in production — always flow through the pipeline.

This ensures that your carefully crafted column spans and tab orders survive every deployment without being accidentally overwritten by a designer save in the wrong environment.


Advanced Pattern: Injecting Controls That the Designer Can't Place

There's a category of control that the designer simply won't let you place: controls that are neither bound to a specific field nor standard components like subgrids. This includes certain types of custom PCF dataset components and web resource HTML controls used as layout anchors.

A web resource HTML control embedded in a form looks like this in XML:

<cell colspan="2" rowspan="1" id="{cell-wr-01}" showlabel="false">
  <control id="WebResource_StatusBanner" 
           classid="{9FDF5F91-88B1-47F4-AD53-C11EFC01674E}" 
           disabled="false">
    <parameters>
      <Url>new_/html/statusbanner.html</Url>
      <PassParameters>true</PassParameters>
      <Security>false</Security>
      <Scrolling>auto</Scrolling>
      <Border>false</Border>
    </parameters>
  </control>
</cell>

The classid {9FDF5F91-88B1-47F4-AD53-C11EFC01674E} is the fixed identifier for the web resource iframe control type. By placing this in a colspan="2" cell at the top of a section, you get a custom HTML banner embedded exactly where you need it — something the designer's control picker often can't target precisely in a complex multi-column layout.

This pattern is powerful in combination with custom pages: you can use a narrow web resource pane to show status context while the main form content is handled by standard Dataverse controls.


Summary & Next Steps

Direct formXml editing is not a workaround or a hack — it's the professional tool for form layout precision. The visual designer is excellent for initial construction and simple changes, but it was never designed to expose the full expressive power of the underlying schema. When you need column spans that cross the designer's grid assumptions, tab orders that reflect workflow logic rather than visual position, spacer cells, or precise placement of PCF and web resource components, the XML is where you go.

The key skills to take away from this lesson:

  • Understand the hierarchy: form → tabs → columns → sections → rows → cells → controls. Everything has a place in this structure and nothing violates it.
  • Use the solution + source control workflow for all XML changes you intend to deploy. The Web API PATCH approach is for iteration only.
  • Generate fresh GUIDs every time you duplicate a cell or row. This is the single most common cause of silent form breakage.
  • Validate before publishing: check column sum integrity, verify datafieldnames against the actual table schema, and use an XML editor with schema support.
  • tabindex is powerful but all-or-nothing — if you use it, audit the entire form's keyboard path, not just the fields you're adjusting.

From here, natural next explorations include:

  • Building PCF controls that sit precisely inside the layouts you've now learned to craft by hand.
  • Combining XML-level form customization with business rules and JavaScript form events, where the control IDs you've carefully defined in the XML become the handles for programmatic manipulation.
  • Exploring solution layering and managed properties to control whether downstream environment admins can open the form designer at all — a critical consideration once you're shipping precise XML layouts as part of a managed solution.

The form XML schema rewards study. The more time you spend reading well-structured form XMLs (export forms from D365 apps, examine the Sales Opportunity form, the Case form — these are sophisticated layouts built by people who know the schema deeply), the more fluent you'll become at writing it.

Work With Us

From insight to implementation

Reading is the start. When you're ready to build the data, automation, or AI systems behind it, our team turns strategy into shipped results.

Let's Build

Model-Driven Apps & Dataverse

Previous

Configuring Dataverse Table-Level Auditing, Audit Log Retention Policies, and Audit History Subgrid Display in Model-Driven App Forms

Related Insights

Power AppsExpert

Canvas App Dynamic Forms: Showing and Hiding Fields, Sections, and Input Controls Based on User Selections and Data Conditions

28 min
Power AppsPractitioner

Configuring Dataverse Table-Level Auditing, Audit Log Retention Policies, and Audit History Subgrid Display in Model-Driven App Forms

26 min
Power AppsPractitioner

Canvas App User Filtering and Search: Building a Live-Search Toolbar with Text Input, Filter, and Gallery Refresh for Practitioner-Grade Data Browsing*

20 min

On this page

  • Introduction
  • Prerequisites
  • Understanding What formXml Actually Is
  • Extracting formXml for Editing
  • Method 1: Export and Unpack a Solution
  • Method 2: Retrieve via Web API
  • Method 3: The customizations.xml Route
  • Controlling Column Span: The colspan Attribute in Depth
  • The Section Column Grid Model
  • Three-Column Sections and Mixed Spans
  • Spacer Cells
  • Controlling Tab Order
  • How the Default Tab Order Works
  • The tabindex Attribute on Controls
  • Practical Example: Call Center Form Tab Order
  • Tab Order Across Sections and Tabs
  • Component Positioning: PCF Controls, Subgrids, and Quick Views
  • PCF Control Syntax in formXml
  • Subgrid Positioning
  • Quick View Forms Embedded in formXml
  • Working with the DesktopLayout and MobileLayout Elements
  • The FormPresenter and Tab Visibility
  • Cell IDs and Uniqueness: A Pitfall You Will Hit
  • Validating Your formXml Before Import
  • Schema Validation
  • Manual Checks Before Import
  • Hands-On Exercise: Restructuring a Procurement Request Form
  • Common Mistakes & Troubleshooting
  • "The form loaded but my column spans are ignored"
  • "The form designer can't open my form anymore"
  • "Import succeeds but Publish All Customizations fails"
  • "My tab order changes are ignored in the app"
  • "I edited the XML and now the designer shows a different layout than what loads at runtime"
  • Keeping XML Customizations Alive in Solutions
  • Advanced Pattern: Injecting Controls That the Designer Can't Place
  • Summary & Next Steps