> For the complete documentation index, see [llms.txt](https://docs.rishvi.co.uk/linnworks/llms.txt).
> Use it to discover all available pages before exploring further.

# 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

<Columns cols="2">
  <Card title="Warehouse & Fulfilment Teams" icon="package" horizontal="false" target="_self">
    Teams preparing orders for picking, packing, label generation, and dispatch can reduce manual address corrections.
  </Card>

  <Card title="Shipping & Logistics Teams" icon="truck" horizontal="false" target="_self">
    Logistics teams can keep delivery address values within courier-supported character limits before labels are generated.
  </Card>

  <Card title="Integration Administrators" icon="settings" horizontal="false" target="_self">
    Administrators configure Charcount, enable the macro, create the Rule Engine action, and monitor execution logs.
  </Card>

  <Card title="Operations Teams" icon="bar-chart-2" horizontal="false" target="_self">
    Operations teams benefit from more consistent address data while retaining original values in internal notes.
  </Card>
</Columns>

## Key Features

<Columns cols="2">
  <Card title="Configurable Character Limit" icon="settings" horizontal="false" target="_self">
    Uses the Charcount parameter to define the maximum permitted length for each checked address field.
  </Card>

  <Card title="Town Validation" icon="check-circle" horizontal="false" target="_self">
    Checks the delivery address Town value and trims it when the configured limit is exceeded.
  </Card>

  <Card title="Company Validation" icon="edit" horizontal="false" target="_self">
    Checks the delivery address Company value and shortens it only when required.
  </Card>

  <Card title="Region Validation" icon="sliders" horizontal="false" target="_self">
    Checks the delivery address Region value against the configured character limit.
  </Card>

  <Card title="Original Value Preservation" icon="layers" horizontal="false" target="_self">
    Stores the original untrimmed value in an internal order note before changing the address field.
  </Card>

  <Card title="Conditional Order Updates" icon="zap" horizontal="false" target="_self">
    Saves customer information only when at least one checked field requires correction.
  </Card>
</Columns>

## 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.

<Steps>
  <Step title="Step 1: Read selected order IDs" title-type="p">
    The macro loops through each order ID supplied through the `OrderIds` parameter.
  </Step>

  <Step title="Step 2: Retrieve the Linnworks order" title-type="p">
    For each selected order ID, the macro retrieves the complete Linnworks order details.
  </Step>

  <Step title="Step 3: Retrieve existing order notes" title-type="p">
    Existing notes are retrieved so the macro can preserve original address values alongside the order.
  </Step>

  <Step title="Step 4: Check delivery Town" title-type="p">
    The delivery address Town value is compared with the configured `Charcount`.
  </Step>

  <Step title="Step 5: Check delivery Company" title-type="p">
    The delivery address Company value is compared with the same configured limit.
  </Step>

  <Step title="Step 6: Check delivery Region" title-type="p">
    The delivery address Region value is checked against `Charcount`.
  </Step>

  <Step title="Step 7: Preserve original values" title-type="p">
    For every value that exceeds the limit, the full original value is added to an internal order note.
  </Step>

  <Step title="Step 8: Trim long values" title-type="p">
    Each qualifying field is shortened to the first number of characters specified by `Charcount`.
  </Step>

  <Step title="Step 9: Save the order changes" title-type="p">
    When at least one field changes, the internal notes and updated customer address information are saved.
  </Step>

  <Step title="Step 10: Record the execution result" title-type="p">
    The macro logs changed fields, unchanged orders, notes saved, errors, and completion.
  </Step>
</Steps>

## 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

<Tabs>
  <Tab title="Step 1">
    **Go to Apps > Macro Configuration and click + Add new configuration.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779094211819-m4d4f11jrx-pasted-image-1779094207771.png?fm=auto&auto=compress%2Cformat" width="1368" height="568" alt="" priority={true} fetchPriority="high" />
  </Tab>

  <Tab title="Step 2">
    **Select the CheckAndUpdateDataCharwise macro and click Create Configuration**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779516543503-y3wfg9juee-pasted-image-1779516540277.png?fm=auto&auto=compress%2Cformat" width="1199" height="548" alt="" priority={true} fetchPriority="high" />

    This creates a new configuration where you can define the character limit parameter used by the macro.
  </Tab>

  <Tab title="Step 3">
    **In the Macro Configuration screen, add the configuration name and parameter values.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779516570937-sai89kihsnb-pasted-image-1779516569360.png?fm=auto&auto=compress%2Cformat" width="668" height="628" alt="" />

    Example configuration name:

    `Address Field Character Limit Check`

    Example parameter value:

    - **Charcount** = `100`
  </Tab>

  <Tab title="Step 4">
    **Make sure to enable the macro to continue with the Rule Engine configuration.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779516596876-nneu48j9c9-pasted-image-1779516595105.png?fm=auto&auto=compress%2Cformat" width="1499" height="27" alt="" />

    <Callout kind="warning" collapsed="false">
      **Note:** If the macro is not enabled, it will not appear in the **Action** value list when setting up the rule.
    </Callout>
  </Tab>

  <Tab title="Step 5">
    **Go to Orders > Rules engine and click + Add new rule.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779094587683-vdcfps4fxa-pasted-image-1779094584371.png?fm=auto&auto=compress%2Cformat" width="1369" height="606" alt="" />

    **Key Benefits**
  </Tab>

  <Tab title="Step 6">
    **Enter the rule name and click Create.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779516616393-7lk70ycbcio-pasted-image-1779516615520.png?fm=auto&auto=compress%2Cformat" width="299" height="181" alt="" style="width: 299px; height: auto; cursor: pointer; margin: 0 auto;" />
  </Tab>

  <Tab title="Step 7">
    **Click Add new, select Condition, set the condition as required, and save it.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779099941621-j5whfpzeq2-pasted-image-1779099937975.png?fm=auto&auto=compress%2Cformat" width="468" height="109" alt="" style="width: 468px; height: auto; cursor: pointer; margin: 0 auto;" />

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779516637805-d389m4gu8he-pasted-image-1779516636234.png?fm=auto&auto=compress%2Cformat" width="598" height="341" alt="" style="width: 598px; height: auto; cursor: pointer; margin: 0 auto;" />
  </Tab>

  <Tab title="Step 8">
    **Add the macro action and click Save.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779516664544-btqj1lxpbk7-pasted-image-1779516663523.png?fm=auto&auto=compress%2Cformat" width="606" height="118" alt="" style="width: 606px; height: auto; cursor: pointer; margin: 0 auto;" />

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779516683349-bgvv83eue28-pasted-image-1779516680980.png?fm=auto&auto=compress%2Cformat" width="607" height="242" alt="" style="width: 607px; height: auto; cursor: pointer; margin: 0 auto;" />

    In the **Add action** window, enter the **Action name**, for example:

    `Character Limit Validation & Fix`

    - Set **Action type** to:

      `Execute a macro`
    - In **Action value**, select:

      `CharacterLimitValidationFix`
    - Click **Save**

    <Callout kind="warning" collapsed="false">
      **Note:** If the macro is not enabled, it will not appear in the **Action** value list when setting up the rule.
    </Callout>
  </Tab>

  <Tab title="Step 9">
    **Review the saved rule setup.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779516722198-jstuyv92ht-pasted-image-1779516721376.png?fm=auto&auto=compress%2Cformat" width="1533" height="703" alt="" style="width: 1533px; height: auto; cursor: pointer; margin: 0 auto;" />

    - Verify the condition and action are connected correctly
    - Click **Save** in the bottom-right corner to save the rule
  </Tab>
</Tabs>

## 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.

<Columns cols="2">
  <Card title="Reduce Manual Address Checks" icon="trending-down" horizontal="false" target="_self">
    Removes the need to open each selected order and manually inspect the checked address fields.
  </Card>

  <Card title="Improve Courier Readiness" icon="truck" horizontal="false" target="_self">
    Helps keep delivery address values within the field-length limits required by courier systems.
  </Card>

  <Card title="Preserve Original Values" icon="layers" horizontal="false" target="_self">
    Stores the complete original value in an internal order note before trimming it.
  </Card>

  <Card title="Maintain Cleaner Address Data" icon="edit" horizontal="false" target="_self">
    Shortens only the delivery address values that exceed the configured limit.
  </Card>

  <Card title="Process Multiple Orders" icon="zap" horizontal="false" target="_self">
    Checks and corrects multiple selected Linnworks orders in a single macro execution.
  </Card>

  <Card title="Avoid Unnecessary Updates" icon="check-circle" horizontal="false" target="_self">
    Leaves orders unchanged when Town, Company, and Region are already within Charcount.
  </Card>
</Columns>

## Usage of App

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

### Execution

<Card title="Trigger via Rule Engine" icon="play" horizontal="false" target="_self">
  Call the CharacterLimitValidationFix action through the Rule Engine with the required `OrderIds` and configured `Charcount` value.
</Card>

### Outcome

When the macro runs against an order, it:

<Steps>
  <Step title="Reads the configured character limit" title-type="p">
    Uses Charcount as the maximum allowed length for each checked delivery address field.
  </Step>

  <Step title="Checks delivery Town" title-type="p">
    Compares the Town value length with the configured maximum.
  </Step>

  <Step title="Checks delivery Company" title-type="p">
    Compares the Company value length with Charcount.
  </Step>

  <Step title="Checks delivery Region" title-type="p">
    Compares the Region value length with Charcount.
  </Step>

  <Step title="Preserves original values" title-type="p">
    Adds internal order notes for every field that requires trimming.
  </Step>

  <Step title="Trims qualifying fields" title-type="p">
    Keeps the first Charcount characters of each field that exceeds the limit.
  </Step>

  <Step title="Saves customer information" title-type="p">
    Updates the Linnworks order only when one or more checked fields were changed.
  </Step>
</Steps>

## Input Parameters

Character Limit Validation & Fix requires the following inputs:

| Parameter     | Required | Description                                                                        |
| ------------- | -------- | ---------------------------------------------------------------------------------- |
| **OrderIds**  | Yes      | The Linnworks order IDs to process. Supplied through the Rule Engine action.       |
| **Charcount** | Yes      | The maximum number of characters permitted in each checked delivery address field. |

Example configuration:

| Setting            | Example                               |
| ------------------ | ------------------------------------- |
| Configuration Name | `Address Field Character Limit Check` |
| Charcount          | `100`                                 |

<Callout kind="warning" collapsed="false">
  **Important:** Charcount should be configured as a positive whole number suitable for the strictest courier, export, or downstream field limit in your workflow.
</Callout>

## Fields Checked by the Macro

The macro checks the following delivery address fields:

| Display Name                | Linnworks Address Field | Checked | Updated |
| --------------------------- | ----------------------- | ------- | ------- |
| **City / Town**             | `Town`                  | Yes     | Yes     |
| **Company**                 | `Company`               | Yes     | Yes     |
| **County / Region**         | `Region`                | Yes     | Yes     |
| **Delivery Address Line 1** | `Address1`              | No      | No      |
| **Delivery Address Line 2** | `Address2`              | No      | No      |
| **Postcode**                | `PostCode`              | No      | No      |
| **Billing address fields**  | Billing address         | No      | No      |

## Character Limit Rules

The macro applies the following validation behaviour:

| Field Condition                        | Macro Behaviour                                                   |
| -------------------------------------- | ----------------------------------------------------------------- |
| Field length is greater than Charcount | Saves the original value in an internal note and trims the field. |
| Field length equals Charcount          | Leaves the value unchanged.                                       |
| Field length is less than Charcount    | Leaves the value unchanged.                                       |
| One or more checked fields are changed | Saves order notes and customer information.                       |
| No checked fields are changed          | Does 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 Setting     | Behaviour                                                      |
| ---------------- | -------------------------------------------------------------- |
| **Visibility**   | Internal                                                       |
| **Created by**   | `CheckAndUpdateDataCharwise Macro`                             |
| **Purpose**      | Preserve the complete original Town, Company, or Region value. |
| **Created when** | A 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:

<Card title="Configured Character Limit" icon="settings" horizontal="false" target="_self">
  Charcount: 20
</Card>

The following orders produce these outcomes:

| Order       | Original Value                                    | Result                                                                                     |
| ----------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| **Order A** | Town: `Very Long City Name Example`               | Original Town is saved in an internal note and Town is trimmed to the first 20 characters. |
| **Order B** | Company: `Example Company Name That Is Too Long`  | Original Company is saved and Company is trimmed to 20 characters.                         |
| **Order C** | Region: `Greater Metropolitan Region Name`        | Original Region is saved and Region is trimmed to 20 characters.                           |
| **Order D** | All checked values contain 20 characters or fewer | No update is made.                                                                         |

<Callout kind="info" collapsed="false">
  The macro truncates the value at the configured character position. It does not attempt to shorten the value at a word boundary.
</Callout>

## Best Practices

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

<Columns cols="2">
  <Card title="Choose Charcount carefully" icon="settings" horizontal="false" target="_self">
    Use a positive whole number that matches the maximum supported field length in your workflow.
  </Card>

  <Card title="Run before label generation" icon="truck" horizontal="false" target="_self">
    Trigger the macro before courier validation or shipping-label creation.
  </Card>

  <Card title="Use targeted rule conditions" icon="sliders" horizontal="false" target="_self">
    Configure the Rule Engine to process only orders that require address-length validation.
  </Card>

  <Card title="Review internal notes" icon="layers" horizontal="false" target="_self">
    Use the generated notes when the complete original address value is needed later.
  </Card>

  <Card title="Test sample values first" icon="check-circle" horizontal="false" target="_self">
    Test Town, Company, and Region values above, below, and exactly equal to Charcount.
  </Card>

  <Card title="Monitor execution logs" icon="bar-chart-2" horizontal="false" target="_self">
    Review logs for field lengths, trimmed values, saved notes, unchanged orders, and API errors.
  </Card>
</Columns>

## 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.

## Legal Information

- **Privacy Policy:** [https://rishvi.co.uk/privacy-policy/](https://rishvi.co.uk/privacy-policy/)
- **Terms and Conditions:** [https://rishvi.co.uk/terms-conditions/](https://rishvi.co.uk/terms-conditions/)

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.

<Columns cols="2">
  <Card title="Automatic field validation" icon="check-circle" horizontal="false" target="_self">
    Delivery Town, Company, and Region values are checked automatically.
  </Card>

  <Card title="Configurable maximum length" icon="settings" horizontal="false" target="_self">
    Charcount controls the maximum number of characters permitted in each checked field.
  </Card>

  <Card title="Original value preservation" icon="layers" horizontal="false" target="_self">
    Complete original values are saved in internal order notes before trimming.
  </Card>

  <Card title="Conditional customer updates" icon="edit" horizontal="false" target="_self">
    Linnworks customer information is saved only when one or more fields require correction.
  </Card>
</Columns>

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.
