Rule MacroRIS-RM-2058 – Character Limit Validation & Fix

Character Limit Validation & Fix

Automatically check selected Linnworks orders for address fields that exceed a configured character limit, store the original values in order notes, and trim the fields to the allowed length.

Overview

Character Limit Validation & Fix is an automated address-cleaning solution for Linnworks. It checks selected orders for delivery address values that exceed a configured maximum character length.

The macro reviews the delivery address Town, Company, and Region fields. Each value is compared with the configured Charcount parameter.

When a field exceeds the permitted length, the macro:

  1. Preserves the original value in an internal order note.
  2. Trims the field to the configured number of characters.
  3. Saves the updated customer information back to the Linnworks order.

Fields already within the configured limit are left unchanged. Billing address fields are not modified by this macro.

Keep important delivery address fields within accepted character limits while preserving their original values for reference.

Who Should Use Character Limit Validation & Fix

Key Features

How Character Limit Validation & Fix Works

Character Limit Validation & Fix follows a defined sequence whenever it receives one or more order IDs through the Linnworks Rule Engine.

Step 1: Read selected order IDs

The macro loops through each order ID supplied through the OrderIds parameter.

Step 2: Retrieve the Linnworks order

For each selected order ID, the macro retrieves the complete Linnworks order details.

Step 3: Retrieve existing order notes

Existing notes are retrieved so the macro can preserve original address values alongside the order.

Step 4: Check delivery Town

The delivery address Town value is compared with the configured Charcount.

Step 5: Check delivery Company

The delivery address Company value is compared with the same configured limit.

Step 6: Check delivery Region

The delivery address Region value is checked against Charcount.

Step 7: Preserve original values

For every value that exceeds the limit, the full original value is added to an internal order note.

Step 8: Trim long values

Each qualifying field is shortened to the first number of characters specified by Charcount.

Step 9: Save the order changes

When at least one field changes, the internal notes and updated customer address information are saved.

Step 10: Record the execution result

The macro logs changed fields, unchanged orders, notes saved, errors, and completion.

Configure the Macro

Once the app is installed, you need to create a macro configuration so the system knows which macro to run and what character limit should be applied.

This setup can be adjusted anytime based on your operational requirements.

Steps to Configure

Go to Apps > Macro Configuration and click + Add new configuration.

Key Benefits

Long delivery address values can cause courier validation errors, failed label generation, export issues, and delays during fulfilment. Character Limit Validation & Fix applies a consistent character limit while retaining the original information.

Reduce manual address cleanup, improve courier readiness, and preserve original field values before shortening them.

Usage of App

Character Limit Validation & Fix is triggered through the Linnworks Rule Engine to check and update selected orders automatically.

Execution

Trigger via Rule Engine

Call the CharacterLimitValidationFix action through the Rule Engine with the required OrderIds and configured Charcount value.

Outcome

When the macro runs against an order, it:

Reads the configured character limit

Uses Charcount as the maximum allowed length for each checked delivery address field.

Checks delivery Town

Compares the Town value length with the configured maximum.

Checks delivery Company

Compares the Company value length with Charcount.

Checks delivery Region

Compares the Region value length with Charcount.

Preserves original values

Adds internal order notes for every field that requires trimming.

Trims qualifying fields

Keeps the first Charcount characters of each field that exceeds the limit.

Saves customer information

Updates the Linnworks order only when one or more checked fields were changed.

Input Parameters

Character Limit Validation & Fix requires the following inputs:

ParameterRequiredDescription
OrderIdsYesThe Linnworks order IDs to process. Supplied through the Rule Engine action.
CharcountYesThe maximum number of characters permitted in each checked delivery address field.

Example configuration:

SettingExample
Configuration NameAddress Field Character Limit Check
Charcount100

Important: Charcount should be configured as a positive whole number suitable for the strictest courier, export, or downstream field limit in your workflow.

Fields Checked by the Macro

The macro checks the following delivery address fields:

Display NameLinnworks Address FieldCheckedUpdated
City / TownTownYesYes
CompanyCompanyYesYes
County / RegionRegionYesYes
Delivery Address Line 1Address1NoNo
Delivery Address Line 2Address2NoNo
PostcodePostCodeNoNo
Billing address fieldsBilling addressNoNo

Character Limit Rules

The macro applies the following validation behaviour:

Field ConditionMacro Behaviour
Field length is greater than CharcountSaves the original value in an internal note and trims the field.
Field length equals CharcountLeaves the value unchanged.
Field length is less than CharcountLeaves the value unchanged.
One or more checked fields are changedSaves order notes and customer information.
No checked fields are changedDoes not update the customer information.

The trimmed value uses the first characters of the original field:

TrimmedValue = OriginalValue.Substring(0, Charcount)

Internal Note Behaviour

When a checked field exceeds Charcount, the original complete value is preserved in an internal order note before the address is changed.

Note SettingBehaviour
VisibilityInternal
Created byCheckAndUpdateDataCharwise Macro
PurposePreserve the complete original Town, Company, or Region value.
Created whenA checked field exceeds Charcount.

The supplied documentation does not define the exact text format used inside each generated note.

Example Scenario

Assume the macro is configured with:

Configured Character Limit

Charcount: 20

The following orders produce these outcomes:

OrderOriginal ValueResult
Order ATown: Very Long City Name ExampleOriginal Town is saved in an internal note and Town is trimmed to the first 20 characters.
Order BCompany: Example Company Name That Is Too LongOriginal Company is saved and Company is trimmed to 20 characters.
Order CRegion: Greater Metropolitan Region NameOriginal Region is saved and Region is trimmed to 20 characters.
Order DAll checked values contain 20 characters or fewerNo update is made.

The macro truncates the value at the configured character position. It does not attempt to shorten the value at a word boundary.

Best Practices

Configure Charcount according to the strictest field-length requirement used by your courier, marketplace, export, or downstream integration.

FAQ

How is Character Limit Validation & Fix triggered?

The macro is triggered through the Linnworks Rule Engine. Matching order IDs are supplied through the OrderIds parameter.

What configuration value is required?

The macro requires the Charcount parameter.

What does Charcount control?

Charcount defines the maximum permitted number of characters in each checked delivery address field.

Which address fields are checked?

The macro checks delivery address Town, Company, and Region.

Does the macro check billing address fields?

No. The supplied documentation states that billing address fields are not updated.

Does it check Address1 or Address2?

No. The documented logic checks Town, Company, and Region only.

What happens when a field exceeds Charcount?

The original value is saved in an internal order note, and the field is trimmed to the first Charcount characters.

What happens when a field length equals Charcount?

The field is not changed because the logic applies only when the value is longer than the configured limit.

What happens when every checked field is within the limit?

No customer-information update is made.

Are original values permanently lost?

The macro preserves the original full values in internal order notes before trimming them.

Who creates the internal notes?

The documentation identifies the note creator as CheckAndUpdateDataCharwise Macro.

Does the macro trim at the nearest space?

The supplied behaviour describes keeping the first Charcount characters. It does not describe word-boundary trimming.

Can multiple fields be changed on the same order?

Yes. Town, Company, and Region can each be checked and corrected during the same execution.

Can multiple orders be processed in one run?

Yes. The macro loops through every order ID supplied through OrderIds.

Does the macro add an identifier?

No identifier behaviour is described in the supplied documentation.

Does the macro update the shipping service?

No. It updates delivery customer address information only.

Does the macro change empty fields?

The source advises that the relevant fields should contain values before the macro runs. It does not describe filling missing fields.

What should be checked when a field is not trimmed?

Confirm that its length is greater than Charcount and that the order was supplied through the configured Rule Engine action.

What should be checked when the macro is unavailable in the Rule Engine?

Confirm that the macro configuration has been created and enabled.

What should be checked when customer information does not save?

Review the execution logs for Linnworks API errors and confirm that the order can be edited.

Please review these pages to understand how data is handled and the terms governing the use of this application.

Summary

Character Limit Validation & Fix automates delivery address length validation for selected Linnworks orders.

Once connected to the Rule Engine, the macro checks delivery Town, Company, and Region against the configured Charcount value. Values that exceed the limit are preserved in internal notes, trimmed to the permitted length, and saved back to the order.

For orders that do not update as expected, review the Rule Engine and macro logs, confirm that Charcount is configured correctly, and verify that the delivery Town, Company, or Region value exceeds the configured limit.