Rule MacroRIS-RM-2071 – Address Field Character Replacemen

Address Field Character Replacement

Automatically replace unsupported or accented characters in selected Linnworks order address fields, record the changes in order notes, and update zero-cost items for international orders.

Overview

Address Field Character Replacement is an automated order-cleaning solution for Linnworks. It checks selected shipping and billing address fields and replaces configured unsupported, accented, or special characters with courier-friendly alternatives.

The macro processes order IDs supplied through the Linnworks Rules Engine. It reviews supported address fields, updates customer information when a replacement is required, and records the original and updated values in an order note.

For international orders, the macro also checks for order items with a cost of 0.0 and updates those items using the cost logic implemented within the macro.

Address Field Character Replacement helps reduce courier validation issues, improve dispatch readiness, and create a traceable record of every address change.

Who Should Use Address Field Character Replacement

Key Features

How Address Field Character Replacement Works

Address Field Character Replacement runs through a defined sequence every time it processes one or more orders. The macro is triggered through the Linnworks Rules Engine and receives the relevant order IDs automatically.

Step 1: Order retrieval

The macro reads each order ID supplied through the OrderIds parameter and retrieves the corresponding order details from Linnworks.

Step 2: Address field analysis

The supported shipping and billing address fields are checked for characters included in the replacement dictionary.

Step 3: Character replacement

Matching characters are replaced with their configured alternatives. Empty fields and characters not included in the dictionary are left unchanged.

Step 4: Customer information update

When at least one address field changes, the updated customer information is written back to the Linnworks order.

Step 5: Order note creation

The macro adds an order note containing the original and updated values for each changed field.

Step 6: International item cost check

If the shipping country is not United Kingdom, the macro checks for order items where Cost is 0.0 and updates those items.

Configure the Macro

Once the app is installed, you need to create a macro configuration so the system knows which macro to run and allows it to be selected in the Rule Engine.

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

Manually reviewing customer addresses across high order volumes can slow down fulfilment and introduce inconsistent corrections. Address Field Character Replacement applies the same configured cleaning rules to every selected order.

Reduce manual address corrections, improve courier compatibility, and maintain a clear record of every change made to an order.

Usage of App

Address Field Character Replacement is triggered through the Linnworks Rules Engine to automatically clean supported address fields on selected orders.

Execution

Trigger via Rules Engine

Call the AddressCharacterReplacement macro through the Rules Engine with the required OrderIds. No additional manual input is required once the rule is active.

Outcome

When the macro runs against an order, it:

Reads order data

Retrieves the order, customer information, supported shipping and billing address fields, and order items from Linnworks.

Checks configured characters

Compares the supported address fields against the built-in character replacement dictionary.

Updates changed address fields

Replaces matching characters and writes the updated customer information back to Linnworks.

Creates an order note

Records the field name, original value, and updated value for each address change.

Updates international zero-cost items

For orders where the shipping country is not United Kingdom, checks for items with Cost equal to 0.0 and updates them.

Input Parameters

Address Field Character Replacement requires the following input before it can process orders:

ParameterRequiredDescription
OrderIdsYesThe Linnworks order IDs to process. Passed through the Rules Engine trigger.

The macro does not require additional custom values in the Macro Configuration screen.

The following behaviour is defined within the macro code:

SettingDescription
Replacement DictionaryDefines the characters that can be replaced and their replacement values.
Supported Address FieldsDefines which shipping and billing fields are checked.
International Order CheckTreats orders outside United Kingdom as international.
Zero-Cost Item HandlingUpdates international order items where Cost is 0.0.

Character Replacement Rules

The macro uses the following configured replacement values:

Original CharacterReplacement
áa
àa
âa
äa
ãa
åa
āa
çc
ée
íi
ñn
óo
úu
ýy
žz
ßss
œoe
æae
,space

Important: Character replacement is case-sensitive. Only the exact characters defined in the macro are replaced.

Best Practices

Consistent Rules Engine configuration and regular monitoring are key to getting the best results from Address Field Character Replacement.

FAQ

How is Address Field Character Replacement triggered?

The macro is triggered through the Linnworks Rules Engine. When an order matches a configured rule, the macro receives the relevant OrderIds automatically.

What address fields does the macro check?

The documented fields are shipping Address1, shipping Address2, shipping Town, shipping Full Name, billing Address1, and billing PostCode.

Does the macro require additional configuration parameters?

No. The macro uses the order IDs supplied through the Rules Engine. No additional custom parameter values are required in the Macro Configuration screen.

Does the macro update every order it receives?

The macro checks every supplied order, but customer information is updated only when at least one supported address field contains a configured character.

Is an order note always created?

No. An order note is created only when one or more address fields have changed.

What information is included in the order note?

The note records the changed field, its original value, and its updated value.

Are the character replacements case-sensitive?

Yes. Only the exact characters defined in the replacement dictionary are replaced.

What happens when an address contains a character that is not configured?

Characters that are not included in the replacement dictionary remain unchanged.

How does the macro identify an international order?

An order is treated as international when its shipping country is not United Kingdom.

Does the macro update UK order item costs?

No. The international zero-cost item step is skipped for orders where the shipping country is United Kingdom.

Which international order items are updated?

The macro checks international order items where Cost is 0.0.

Can additional characters be added to the replacement dictionary?

Yes. The macro code must be updated and tested before the new replacement rules are used in a live workflow.

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

Summary

Address Field Character Replacement automates the cleaning of supported shipping and billing address fields on selected Linnworks orders.

Once configured through the Rules Engine, the macro checks each supplied order, replaces configured characters, updates customer information when required, and records every address change in an order note.

For international orders, the macro also checks for order items with a cost of 0.0 and updates those items using the logic implemented within the macro.

For orders that do not produce the expected result, review the Rules Engine logs, confirm that the macro configuration is enabled, and verify that the address contains an exact character from the replacement dictionary.