When working with Logic Apps, especially for enterprise integrations involving external systems, it’s common to receive flat file formats like CSV. And what do most people do when they get a CSV file? They start chopping it up using split()
, compose, for eact and Parse JSON actions
, and array variables
and many more crazy implementations that often lead to large, messy chains of Compose actions, and those strategies will not be efficient in performance.
But there’s a better, cleaner, and native way to handle this: Flat File Schemas. We can use them with an Integration Account inside Logic App Consumption, or they are available inside Logic App Standard by default.
What are Flat File Schemas?
Flat File Schemas define how a flat file (like a CSV or fixed-width format) should be parsed into a structured XML representation. It’s the same concept used in BizTalk Server, and Microsoft has brought this powerful capability into Azure Logic Apps. These types of Flat Files are supported:
- Positional defines each data item as a pre-established length, with pad characters being used to bring a shorter item of data up to its expected length.
- And delimited, uses one or more special characters to separate items of data from each other. This methodology avoids the need for otherwise superfluous pad characters but introduces some special considerations when the data itself contains the character or sequence of characters being used as a delimiter.

How does this help?
Using Flat File Schemas in Logic Apps, you can convert your CSV input directly into XML, ready for XPath queries, mapping, transformation, or even direct HTTP POSTs to downstream systems — no need to reinvent the parsing wheel.
If you later want to convert it to JSON, just use the json() expression.
The Workflow
Here’s how you can set it up:
- If you use Logic App Consumption, create an Integration Account (if you don’t have one).
- Define a Flat File Schema (.xsd) and the corresponding flat file definition (.xml) using Visual Studio with the Enterprise Integration SDK.
- Upload the schema to your Integration Account (Consumption) or into your Schemas Artifacts inside Logic App Standard.
- In your Logic App:
- Use the Flat File Decoding action to parse the raw CSV into XML.
- Optionally use XML Validation to ensure the format is correct.
- Process the resulting XML using standard XML-based actions or transformations (like XSLT or Liquid).
Why is this better?
- Scalability: Handles large files more reliably than manual parsing.
- Maintainability: Schemas are versionable and reusable across multiple integrations.
- Accuracy: No risk of incorrect splitting or format assumptions.
- Clean workflows: Say goodbye to long Compose chains and brittle expressions.
Pro Tip
This technique works beautifully with integration patterns where partners send data via SFTP, blob storage, or HTTP. As long as the file lands in Logic Apps, you can decode it with your schema and move on to real business logic, not string manipulation gymnastics.
So next time you’re tempted to split()
your way through a CSV file in Logic Apps… remember Flat File Schemas exist for a reason. And they’re way more elegant.
To lazy to read? We’ve got you covered! Check out our video version of this content!
Hope you find this helpful! If you enjoyed the content or found it useful and wish to support our efforts to create more, you can contribute towards purchasing a Star Wars Lego for my son!