EDIFACT encoder in Logic App escapes whitespaces in all string literal values

Strömberg Johannes 0 Reputation points
2025-12-11T15:23:17.8266667+00:00

We have a couple of logic apps which outputs EDIFACT messages using the EDIFACT encoder but for some reason it's adamant in it's escaping of whitespaces in string literals. We have used schemas from BizTalk and we've set up the following in the integration account agreement:

Apply UNA Segment - Checked

Character Sets and Separators - UNB1.1 - UNOC

Parameter Value
Input type Blank (we tried "Char" but it didn't save that choice)
Component Separator :
Data Element Separator +
UNA3 (Decimal Notation) Comma
UNA4 (Release Indicator) ?
UNA5 (Repetition Separator) whitespace
Segment Terminator '
Suffix None

No validation is active

We've had this solution running in BizTalk 2020 for years now and it's been fine, but running it in a Logic App it has this escaping issue. Example:

Output from BizTalk:

STS+1+3::87:All Ok. Status is green'

Output from Logic Apps (same input file):

STS+1+3::87:All? Ok.? Status? is? green'

How can we get the same behavior in Logic Apps as we had in BizTalk (i.e stop it from escaping whitespaces in string literals)?

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
{count} votes

1 answer

Sort by: Most helpful
  1. Rakesh Mishra 4,115 Reputation points Microsoft External Staff Moderator
    2025-12-11T16:29:12.28+00:00

    Hi @Strömberg Johannes ,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    Logic Apps is correctly inserting the EDIFACT release indicator (UNA4, your ?) before every character that your agreement declares as a separator (in your case you configured the repetition separator UNA5 as a whitespace). Because you told the encoder that the space is a separator, the encoder escapes spaces in data by prefixing them with the release indicator — which is exactly the All? Ok.? Status? is? green you see.

    Please try below and share your findings.

    1. Don’t use whitespace as the repetition separator (UNA5).
      Reason: UNA5 is the repetition separator — if it’s set to a space, any space in a free-text data element is treated as a repetition separator and therefore must be escaped. Remove the whitespace value or choose a non-conflicting character (or leave UNA5 unset) so ordinary spaces are not treated as separators.
    2. Only generate a UNA segment when you need non-standard separators. The docs say to use the UNA segment only if your interchange uses non-standard separator characters; if you don’t need a custom repetition separator, don’t set it / don’t apply UNA. This avoids making space a special character.
    3. How to change it in the portal (where to click — per docs):
      • Open your Integration AccountAgreements → edit the relevant agreement.
      • Under the agreement’s Send / Character Sets and Separators section, change the UNA/Repetition Separator (UNA5) — either clear it (no char) or set a safe single character that will not appear in free-text. Save the agreement.
    4. Test using the EDIFACT encode action (after changing agreement): use the Encode to EDIFACT message by agreement name action in your Logic App and verify output. The EDIFACT connector/encode action is documented in the Logic Apps EDIFACT guide.
    If the trading partner requires a space as repetition separator

    If the partner actually insists on a space as the repetition separator, you have two unpleasant choices (both non-standard and partner-specific):

    • Pre-escape or transform free-text content so it does not contain raw spaces (ugly and likely unacceptable), or
    • Agree with the partner to use a different repetition separator (recommended) so free text does not need escaping.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.