web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

Nice Label JSON escape character

(6) ShareShare
ReportReport
Posted on by 22
Hello Community,
 
Looking to see if there is a method to replace/remove the JSON escape characters (",/).
 
To reproduce
  • Warehouse management > Setup > Document routing > Label layout
  • Set Label layout type = License Plate Label
  • Under Data variables
    • Set Variable name
    • Set Value (with the escape characters replaced/removed)
 
I have the same question (0)
  • Jonas "Jones" Melgaard Profile Picture
    4,926 Most Valuable Professional on at
    I don't recall having seen a parameter that can do this, I'm afraid you are looking into making a customization.
    But it sounds a bit odd... Can you share some of the label file with the escape character present?
  • CA-08101231-0 Profile Picture
    22 on at
    Our current dilemma is that we require the Item Name on the LP label. Example of an item = 1/4" pipe 
     
    With the layout of the label as below, the JSON created results in
    "Variables": [
    {
                    "ItemId": "1000-0934",
                    "ItemIdBC": "1000-0934",
                    "ItemName": "1/4" Pipe",
        }
    ]
    Thus, causing an error when sending.
     
  • Suggested answer
    Jonas "Jones" Melgaard Profile Picture
    4,926 Most Valuable Professional on at
    I see. It can be problematic having quotation marks (") in item names.
    Is it out of the question to change the item name?

    I was about to recommend using custom formats, but it seems that this approach is limited when it comes to strings. See here for more information: Document routing label layouts - Supply Chain Management | Dynamics 365 | Microsoft Learn

    I'm afraid that my best answer is to create a display method on the WHSLicensePlateLabel table that escapes the quotation marks, and then you can add that method as an attribute.
     
  • Suggested answer
    Anton Venter Profile Picture
    20,345 Super User 2025 Season 2 on at
    Escaping the " character is better than removing it. It should be possible with a small customization.
     
     
     

    ​​​​​​​
     
  • CA-08101231-0 Profile Picture
    22 on at
    Thanks Jonas.
     
    I dug a little further through the code and Microsoft is hard coding the format when creating the translation from the values.
     
  • Jonas "Jones" Melgaard Profile Picture
    4,926 Most Valuable Professional on at
    These classes are internal, unfortunately.
    Ideally, you could raise an extensibility request to Microsoft and submit it as a bug (i.e., it should be possible to select the formatting when configuring the label layouts).

    But until the request is processed, since it's hard-coded, you will have to write your own display method to handle the escaping.
  • Jackson Eagle Profile Picture
    20 on at

    Hey, I’ve run into this exact issue before — the problem is the double quote in your string ("1/4" Pipe"). JSON doesn’t like unescaped quotes, so it’s breaking the payload.

    Easiest fix is to escape those quotes before sending the string. If you don’t want to write a quick script, you can just use JSON Escape tool. Paste in your text, and it’ll automatically escape the special characters.

    If you want to double-check the result, you can run it through JSON Unescape tool— it converts it back so you can verify you’re not escaping too much or too little.

    Once you use the escaped version in your label code, the error should go away.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Siv Sagar Profile Picture

Siv Sagar 266 Super User 2025 Season 2

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 213 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 140 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans