Skip to content

Commit 530d2b1

Browse files
authored
Merge pull request #312308 from ecfan/parse-issue
[Azure Logic Apps] Parse XML using schema action - Repeating element order isn't preserved after parsing
2 parents 94a4281 + 5d82823 commit 530d2b1

1 file changed

Lines changed: 77 additions & 20 deletions

File tree

articles/logic-apps/logic-apps-enterprise-integration-xml-parse.md

Lines changed: 77 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,53 @@
11
---
22
title: Parse XML using Schemas in Standard workflows
3-
description: Learn how to parse XML documents using schemas in Standard workflows with Azure Logic Apps.
3+
description: Learn how to parse XML documents by using schemas in Standard workflows with Azure Logic Apps. Discover how to work with individual XML elements in your workflows.
44
services: logic-apps
55
ms.service: azure-logic-apps
66
ms.suite: integration
77
author: haroldcampos
88
ms.author: hcampos
99
ms.reviewers: estfan, azla
1010
ms.topic: how-to
11-
ms.date: 11/18/2025
11+
ai-usage: ai-assisted
12+
ms.date: 02/25/2026
13+
#Customer intent: As an integration developer who works with Azure Logic Apps, I want to parse XML documents by using an XSD schema so I can work with individual XML elements in my workflow.
1214
---
1315

14-
# Parse XML using schemas with Standard workflows in Azure Logic Apps
16+
# Parse XML by using schemas in Standard workflows with Azure Logic Apps
1517

1618
[!INCLUDE [logic-apps-sku-standard](../../includes/logic-apps-sku-standard.md)]
1719

18-
In enterprise integration business-to-business (B2B) or BizTalk migration scenarios, you might have to parse XML documents. Your Standard logic app workflow can parse XML by using the action named **Parse XML with schema**, which requires an XSD schema.
20+
In enterprise integration scenarios, such as business-to-business (B2B) or BizTalk migrations, you might need to parse XML documents. Standard logic app workflows in Azure Logic Apps can parse XML using the action named **Parse XML with schema**, which requires an XSD schema.
1921

20-
For example, suppose you regularly receive customer orders or invoices that use XML as the exchange format and need to access individual XML elements in the workflow designer for Azure Logic Apps.
22+
For example, suppose you regularly receive customer orders or invoices in XML format. Suppose you must access individual XML elements directly in the workflow designer for Azure Logic Apps.
2123

2224
## Limitations
2325

24-
This action is currently not yet supported for the [Consumption logic app resource and workflow](logic-apps-overview.md#resource-environment-differences).
26+
The [Consumption logic app resource and workflow](logic-apps-overview.md#resource-environment-differences) doesn't support this action.
2527

2628
## Prerequisites
2729

28-
* An Azure account and subscription. If you don't have a subscription yet, [sign up for a free Azure account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
30+
- An Azure account and subscription. [Get a free Azure account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
2931

30-
* A Standard logic app workflow that already starts with a trigger so that you can add the **Parse XML with schema** action to your workflow.
32+
- A Standard logic app workflow that starts with a trigger so that you can add the **Parse XML with schema** action to your workflow.
3133

32-
* An [integration account resource](enterprise-integration/create-integration-account.md) where you define and store artifacts, such as trading partners, agreements, certificates, and so on, for use in your enterprise integration and B2B workflows. This resource has to meet the following requirements:
34+
- An [integration account resource](enterprise-integration/create-integration-account.md) where you define and store artifacts, such as trading partners, agreements, certificates, and other items, for use in your enterprise integration and B2B workflows. This resource must meet the following requirements:
3335

34-
* Is associated with the same Azure subscription as your logic app resource.
36+
- Is associated with the same Azure subscription as your logic app resource.
3537

36-
* Exists in the same location or Azure region as your logic app resource where you plan to use the **Parse XML with schema** action.
38+
- Exists in the same location or Azure region as your logic app resource where you plan to use the **Parse XML with schema** action.
3739

38-
* If you're working on a [Standard logic app resource and workflow](logic-apps-overview.md#resource-environment-differences), you can link your integration account to your logic app resource, upload XSD schemas directly to your logic app resource, or both, based on the following scenarios:
40+
- If you're working on a [Standard logic app resource and workflow](logic-apps-overview.md#resource-environment-differences), you can link your integration account to your logic app resource, upload XSD schemas directly to your logic app resource, or both, based on the following scenarios:
3941

40-
* If you already have an integration account with the artifacts that you need or want to use, you can link your integration account to multiple Standard logic app resources where you want to use the artifacts. That way, you don't have to upload XSD schemas to each individual logic app. For more information, review [Link your logic app resource to your integration account](enterprise-integration/create-integration-account.md?tabs=standard#link-account).
42+
- If you already have an integration account with the artifacts that you need or want to use, you can link your integration account to multiple Standard logic app resources where you want to use the artifacts. You don't have to upload XSD schemas to each individual logic app. For more information, see [Link your logic app resource to your integration account](enterprise-integration/create-integration-account.md?tabs=standard#link-account).
4143

42-
* If you don't have an integration account or only plan to use your artifacts across multiple workflows within the *same logic app resource*, you can [directly add schemas to your logic app resource](logic-apps-enterprise-integration-schemas.md) using either the Azure portal or Visual Studio Code.
43-
44-
So, if you don't have or need an integration account, you can use the upload option. Otherwise, you can use the linking option. Either way, you can use these artifacts across all child workflows within the same logic app resource.
44+
- If you don't have an integration account or only plan to use your artifacts across multiple workflows within the *same logic app resource*, you can [directly add schemas to your logic app resource](logic-apps-enterprise-integration-schemas.md) by using either the Azure portal or Visual Studio Code.
4545

46-
You still need an integration account to store other artifacts, such as partners, agreements, and certificates, along with using the [AS2](logic-apps-enterprise-integration-as2.md), [X12](logic-apps-enterprise-integration-x12.md), and [EDIFACT](logic-apps-enterprise-integration-edifact.md) operations.
46+
- If you don't have or need an integration account, you can use the upload option. Otherwise, use the linking option. Either way, you can use these artifacts across all child workflows within the same logic app resource.
4747

48-
* The XSD schema to use with the **Parse XML with schema** action. Make sure that this schema includes a root element, which looks like the following example:
48+
You still need an integration account to store other artifacts, such as partners, agreements, and certificates, if you use the [AS2](logic-apps-enterprise-integration-as2.md), [X12](logic-apps-enterprise-integration-x12.md), and [EDIFACT](logic-apps-enterprise-integration-edifact.md) operations.
49+
50+
- The XSD schema to use with the **Parse XML with schema** action. Make sure that this schema includes a root element, which looks like the following example:
4951

5052
```xml
5153
<xs:element name="Root">
@@ -63,7 +65,7 @@ This action is currently not yet supported for the [Consumption logic app resour
6365

6466
1. Under the step in your workflow where you want to add the **Parse XML with schema** action, [follow these general steps to add the action named **Parse XML with schema**](create-workflow-with-trigger-or-action.md?tabs=standard#add-action).
6567

66-
1. In the **Content** box, specify the XML content that you want to parse using any XML data that you receive in the HTTP request.
68+
1. In the **Content** box, specify the XML content that you want to parse by using any XML data that you receive in the HTTP request.
6769

6870
1. To select outputs from previous operations in the workflow, in the **Parse XML with schema** action, select inside the **Content** box, and select the dynamic content list option (lightning icon).
6971

@@ -99,6 +101,61 @@ The following table describes the advanced parameters available in this action:
99101
| **Use Fully Qualified Names?** | **No** or **Yes** | Whether to use simpler local names or fully qualified XML names. |
100102
| **Root Node Qualified Name** | <*root-node-qualified-name*> | The root node's qualified name in case the schema contains multiple unreferenced element definitions. |
101103

104+
## Troubleshoot problems
105+
106+
This section describes problems that you might encounter and possible solutions or workarounds to address these problems.
107+
108+
### XML element order isn't preserved
109+
110+
If your XML has repeating elements that appear in mixed order, the **Parse XML with schema** action might not preserve the original order and groups these elements by their name in alphabetical order.
111+
112+
This behavior is expected because the **Parse XML with schema** action converts the XML to JSON. This format doesn't have a way to represent a single ordered list with different types of items. Instead, the action groups the elements by name in alphabetical order.
113+
114+
For example, suppose you have items with the following names in this specific order: `A`, `B`, `B`, `A`:
115+
116+
**Before**
117+
118+
```xml
119+
<Items>
120+
<A>1</A>
121+
<B>2</B>
122+
<A>3</A>
123+
<B>4</B>
124+
</Items>
125+
```
126+
127+
After the action parses the XML, the resulting JSON groups and reorders these items by name as follows: `A`, `A`, `B`, and `B`:
128+
129+
**After**
130+
131+
```json
132+
{
133+
"A": ["1", "3"],
134+
"B": ["2", "4"]
135+
}
136+
```
137+
138+
The **Parse XML with schema** action doesn't have any setting that preserves the order of mixed repeating elements. This limitation results from converting XML to JSON.
139+
140+
The following list describes options for you to fix or work around this problem:
141+
142+
- If you control the schema, design the schema so you have only one repeating list without multiple repeating element types.
143+
144+
For example, rather than separately repeat `A` and `B`, use a single repeating wrapper element, such as `Item`. Each item then indicates whether `A` or `B` is represented. The system can then keep all the items in a single ordered list and preserve the original order. This option is best for long-term, predictable behavior.
145+
146+
- If the original order is required or critical, don't parse the XML.
147+
148+
- Avoid breaking up the XML into JSON.
149+
- Handle the XML document as a whole.
150+
- Pass the XML document unchanged or transform the content by using XML-based tools such as XSLT.
151+
152+
- Keep this limitation in mind.
153+
154+
If you can't change the schema or workflow, remember the following:
155+
156+
- Mixed repeating elements are grouped by element name, losing the original order.
157+
- Design the downstream logic with this behavior in mind.
158+
102159
## Related content
103-
160+
104161
- [Compose XML with schema](logic-apps-enterprise-integration-xml-compose.md)

0 commit comments

Comments
 (0)