Skip to main content

Notifications

Community site session details

Community site session details

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

Document Routing Labels, ZPL, and field substitution

(1) ShareShare
ReportReport
Posted on by 2
I'm maintaining some Label in Document Routing that a previous developer coded, and I see that they used $itemfieldname$ coding to insert a value from a table during real time printing of labels.
 
Is there any documentation on how this substitution functionality works? Specifically, are they any parameters to this function? For example, are the parameters that allow me to specify which part of the value I wish to print? If, for example, the field/variable was an item number and you only wanted to print the first three characters, could you do something line $itemfieldname$:1-3?
 
Any light that can be shared on this function would be greatly appreciated.
 
Scott Lineberger
Coastal Industries, Inc.
 
  • Uzair Siddiqui Profile Picture
    9 on at
    Document Routing Labels, ZPL, and field substitution
    Simple solution would be to created a method to populate the with the limited characters and then replace the ZPL placeholder.
  • Suggested answer
    Danny Bilodeau Profile Picture
    4,597 Moderator on at
    Document Routing Labels, ZPL, and field substitution
    Hi SL,
    Here is an old post that explains the mechanics of it all: https://kashperuk.blogspot.com/2016/10/tutorial-extending-label-printing.html
     
    Back then the table used to generate Labels was the WHSLicensePlateTable so you will see several mention of that table. Now, with customs labels you can use pretty much any table as the source of the data.  The principles would have remained the same, just replace your table's name as the source of your License Plate / Container / Customs label and you can understand the general mechanics.
     
    The %fieldname% is simply a placeholder (or variable) that you insert in the zpl code and that is being replaced by the real value at the time of label printing. That variable can't just be anything, it must be an available field from the table you are using.    
     
    On the question of the existence of a parameter to truncate a string value, there is no such parameter and there is no zpl instruction that will do so.  For this to occur will require pre-processing before the coded label is sent to the label printer; a developer would be able to assess the feasibility and effort required for that pre-processing.  
  • Laurens vd Tang Profile Picture
    2,825 Super User 2025 Season 1 on at
    Document Routing Labels, ZPL, and field substitution
    Good day Scott,
     
    Which layout do you use? There are few options:
     
    • Document routing layout
    • Label layout
    • Wave label layout
    I believe it is not possible print only the first three or two characters of a value.
     
    Best regards,
    Laurens van der Tang

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Zain Mehmood Profile Picture

Zain Mehmood 462 Moderator

#2
Danny Bilodeau Profile Picture

Danny Bilodeau 156 Moderator

#3
Laurens vd Tang Profile Picture

Laurens vd Tang 120 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans