Introduction
If you are an
Architect, you know that mixing them up is a recipe for disaster.
Today, let’s clear the confusion. We will break down exactly what these terms mean using simple English. We will also look at how a tool like Azure Logic Apps handles a real-world Purchase Order (PO) across different formats like Flat Files, EDI, XML, and JSON.
By the end of this post, you’ll know exactly which "box" to drag onto your workflow canvas.
The Simple Definitions
Think of your integration as a conversation between two people who speak different languages and come from different cultures.
1. Translation (The Interpreter)
Translation
is changing the Format (Syntax).
It’s like translating a sentence from English to Spanish. You don’t change the meaning; you just change the words so the other person can hear them.
Goal:
Make sure System B can read the file System A sent.
Complexity: Simple. It’s usually a
direct swap.
Example: Changing a CSV file (Comma
Separated) into a JSON file (Curly Braces). The number "100" is still
just "100".
2. Transformation (The Problem Solver)
Transformation
is changing the Logic or Value (Semantics).
This is where you apply business rules. It’s not just about language; it’s about making sense of the information.
Goal: Make sure the data follows the rules
of the target system.
Complexity: Harder. It involves math,
looking up data in a database, or combining fields.
Example: Calculating `Total Cost =
Price * Quantity`. Or changing a date from
"Oct 27, 2023" to "2023-10-27".
Simple Way to Remember
Translation = Format change
Transformation = Data change or logic applied
The Real World Scenario: The Purchase Order
Let’s imagine
a standard scenario.
Source: An old internal system sending a
Purchase Order (PO).
Target: A modern online store system.
Tool: Azure Logic Apps.
Let’s see how
Translation and Transformation look for different file types.
1. The Flat File (CSV)
Flat files
are just lines of text separated by commas. Old systems love them.
Source Data: `PO123,20231027,ItemA,10,20`
The Translation (Format Change):
Using Logic
Apps' "Flat File Decoding" action. We take that text line and
turn it into XML or JSON so the computer can read it easily. We aren't changing
values yet.
Result: We just have a structured list
of those exact values.
Flat File Encode :- Converts XML or JSON back to CSV or flat file.
The Transformation (Logic Change):
Now we use
Logic Apps' "Data Operations" or a Liquid Map.
1. Date
Fix: The source says `20231027`. The target needs dashes: `2023-10-27`.
2. Math:
The source has Quantity (10) and Price (20). The target wants the Total. We
create a new field: `Total = 200`.
Liquid Template :- Rearranges CSV data into target structure.
Select:- Map columns to new format.
Compose:- Modify individual values.
Inline Code:- Handle complex CSV logic or formatting.
2. EDI
EDI is a very compressed code used by big retailers (like Walmart or Amazon). It looks like gibberish to humans.
Source Data: `BEG00PO123~`
The Translation:
In Logic
Apps, you use the Integration Account. You use an "EDI Receive"
shape. This acts as the Interpreter. It reads the confusing EDI code and
instantly translates it into standard XML that you can actually read.
Key Point: No business rules happen
here. Just unzipping the code.
EDI Decode :- Converts EDI message into readable XML.
Example:
850 Purchase Order EDI → XML
EDI Encode:- Converts XML back into EDI format.
The Transformation:
Now that it is XML, we apply the rules. The EDI file might use a code `VP` for "Vendor Part". Your database doesn't know what `VP` means; it just wants the Part Number. You map the value inside the `VP` field to your database's `PartNumber` field.
Transform XML:- Maps decoded EDI XML to internal business format.
Liquid Template:- Alternative mapping method for partner-specific formats.
3. XML
XML is structured but can be very deep and complex.
Source
Data: xml
<Price
currency="USD">20.00</Price>
The Translation:
Converting
XML to JSON using the `json()` function in Logic Apps.
Challenge: XML has "attributes" (like
`currency="USD"` inside the tag). JSON doesn't work that way. A
translation might force this into a messy field like `_currency`.
Parse XML :- Converts XML text into a readable structure so Logic Apps can use it.
Example:
You receive:
<Customer><Name>John</Name></Customer>
Parse XML lets you easily read Name inside workflow.
When to Use:
- When XML is received from API / file / queue
- When you want to access XML fields
XML to JSON Auto Conversion:- Converts XML data into JSON format or JSON into XML.
Example:
System A sends XML but System B needs JSON → Logic App converts automatically.
XML Validation:- Checks whether XML follows a defined schema (rules/structure).
Example:
Ensures Purchase Order XML contains required fields like Order ID and Date.
The Transformation:
We need to
clean that up. We use a transformation map to pull "USD" out of the
attribute and make it a proper field: `"currencyCode":
"USD"`. We might also filter out items. If the XML has a tag
`<Status>Pending</Status>`, we might use a logic condition to discard
that order entirely because we only want "Approved" orders.
Transform XML (Liquid / XSLT):- Changes XML structure or applies business rules.
Example:
Partner sends:
<CustomerName>
Your system needs:
<ClientName>
Transformation maps fields.
xpath() :- Extracts specific values from XML.
Example: Get only Order Number from large XML.
Compose :- Stores or slightly modifies XML data.
Example: Combine two XML values into one field.
4. JSON
JSON is what
most modern APIs use. It uses curly braces `{ }`.
Source Data: json
{
"user": "John Doe", "region": "NA" }
The Translation:
Often, you
don't need to translate JSON if your target is also a modern API. But if you
are sending this to an old system, you might translate JSON back to XML or CSV.
Parse JSON:- Converts JSON text into structured data.
Example: Allows accessing:customer.name
Compose (Format Conversion):- Converts or reshapes JSON format slightly.
Built-in JSON Serialization:- Automatically converts objects into JSON when sending data to APIs.
The Transformation:
Enrichment: The JSON only has a name:
"John Doe". Your target system needs an email. You use a Logic App
connector to look up "John Doe" in Office 365, get his email
(`john@example.com`), and inject it into the message.
Masking: If you are saving this to a
log file, you might want to hide the name for privacy. Changing "John
Doe" to "J D" is a transformation.
Select:- Maps JSON fields to new structure.
Example:Change:
FirstName, LastName
To:
FullName
Filter Array:- Removes unwanted records.
Example: Keep only orders with Status = Approved.
Join:- Combines multiple values into
one.
Compose:- Modify or calculate JSON
values.
Liquid Template:- Used for complex mapping
between schemas.
Inline Code:- Write JavaScript or C# for
advanced transformation.
Example: Complex calculation or nested loops.
5.Non schema content like Binary / Base64 Content
Translation Actions
base64():- Converts content into Base64 encoded format.
base64ToString():- Converts Base64 content into readable text.
stringToBase64():- Converts text into Base64.
Transformation Actions
Compose:- Modify decoded content.
Inline Code:- Used when binary content needs advanced processing.
Which Logic App Action to
Use?
Here is a
quick reference for Architects designing their solution.
|
Task |
What is
it? |
Logic
App Feature to Use |
|
Convert
CSV to XML |
Translation |
Flat
File Decoding (Integration Account) |
|
Convert
EDI to XML |
Translation |
EDI
Decode (Integration Account) |
|
Convert
XML to JSON |
Translation |
json(xmlContent)
Function |
|
Calculate
Totals |
Transformation |
Compose
Action or Liquid Map |
|
Date
Formatting |
Transformation |
formatDateTime()
Expression |
|
Lookup
Database |
Transformation |
SQL
Connector (Get Row) |
Summary
Think of it this way:
Translation is about the Container.
You are just changing the box the data comes in (from a cardboard box to a
wooden crate).
Transformation is about the Contents.
You are opening the box, fixing the broken parts, adding missing manuals, and
polishing the product.
Translation Actions (Format Change Only) - Used when you just need to convert data format
Common ones:
Parse JSON
Parse XML
Flat File Decode / Encode
EDI Decode / Encode
Base64 functions
Transformation Actions (Apply Logic or Restructure Data) - Used when you need to modify data
Common ones:
Transform XML (Liquid / XSLT)
Select
Filter Array
Join
Compose
Inline Code
As an
Architect, keeping these separate makes your life easier. If the file format
changes (Translation), you don't break your business rules (Transformation). In
tools like Azure Logic Apps, this separation is built right in—so use
it!
Learn More about Logic App
- How to configure Logic App Standard workflow behind Azure APIM
- How to Query Azure Table storage from Logic App | How to filter results of Azure Table storage from Logic App
- Understanding expressions in Logic Apps | Frequently used expressions in Logic Apps | What is expressions in Logic App
- How to use Logic app Run History | How to troubleshoot Logic App workflow execution
- Logic App and Slack - Sending messages to slack channel | Logic app and slack integration | Connecting Logic App to Slack channel
- How to access Application settings fields value from Logic app Standard workflow | Using Application settings as configuration store for Logic app standard workflow
- Developing Logic app standard workflow which uses Map locally and deploying to Azure
- Developing Logic App Standard Workflow Using Visual Studio Code | Create Logic App Standard Workflow Using Visual Studio Code
- Logic App - Xml to Json using Liquid Map | Append in Liquid Map
- How to use Azure Event Grid Custom Topic | Publishing and Subscribing from Azure Event Grid Custom Topic using Logic App
- Using Azure Storage Account Table as Config Store for Logic Apps | How to read and write from Logic App to Azure Storage Account Table
- Get Logic App Name in Logic App
- Difference between Logic App Consumption and Logic App Standard
- Getting Started with Logic App Standard | Overview of Logic App Standard | Basics of Logic App Standard
- How to find count of Logic App executions using Azure Portal
- Azure Functions vs Azure Logic App | Difference between Azure Functions and Azure Logic App
- Getting started with Logic App : Liquid Map | Using Liquid template in Logic app
- How to get actual error message of Scope in Logic App | Exception Handling in Logic app
- Interview questions and answers on Logic Apps | Interview questions for azure logic app developers
- How to execute Stored Procedure in Logic App | How to connect to SQL in Logic App
- How to get current date in logic app | How to format date time in Logic App
- BizTalk Developer getting started with Logic App
- Getting Started with Logic Apps - Fundamentals
- Getting Started with Logic Apps - Enterprise Application Integration
- Getting Started with Logic Apps - AS2
- Getting Started with Logic Apps - EDI X12 Fundamentals
- Getting Started with Logic Apps - XML to EDI X12
- Getting Started with Logic Apps - EDI X12 to XML
- Getting Started with Logic Apps - What happened to the Request?
- Inserting Multiple Records In On Prem SQL Using Logic App
- Inserting data in On Premises SQL Database using Logic Apps
- Installing and Configuring On Premises Data Gateway - By adding user to Active Directory
- XML Batching(Aggregation) in Logic App
- Batching(Aggregating) messages in Logic App
- Debatching(Splitting) JSON Message in Logic Apps - ForEach and SplitOn
- Debatching(Splitting) XML Message in Logic Apps - ForEach and SplitOn
- Securing Logic App with Azure Active Directory authentication
- Removing ns0: prefix from xml output from BizTalk/Logic app XSLT map
- Using Managed Identity in Logic Apps for Calling Active Directory Secured Function App
- Logic Apps : Fetching ISA and GS Segment Values From Interchange Envelope and Mapping
- Logic Apps : For Each Inside a For Each - Fetching values from field in an array inside an array