Missing Town & Region Fix
Automatically update selected Linnworks orders when customer delivery or billing address region and town fields are missing.
Incomplete address information can delay order validation, fulfilment, and courier processing. The No Empty Region macro helps keep selected order address data complete by applying a defined region value where required.
This macro checks each selected order and reviews the customer delivery and billing address details. When the order needs updating, the macro fills missing Region fields with the configured RegionName value. If a Town field is missing, the macro fills it using the relevant address Region value.
With this automated approach, your team can reduce manual address corrections, improve order data consistency, and prepare selected orders for smoother downstream processing.
Keep selected order address information complete by automatically filling missing Region and Town values.
Configure the Macro
Once the app is installed, you need to create a macro configuration so the system knows which macro to run and which default region value 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.

Select the MissingTownAndRegionFix macro and click Create Configuration.

This creates a new configuration where you can define the required region parameter.
In the Macro Configuration screen, add the configuration name and parameter value.

Configure the required parameter:
- RegionName — enter the default region value that should be used when an order address has an empty Region field.
Example:
Configuration Name: Missing Town & Region Fix
RegionName: Greater London
Note: The value entered in RegionName is applied to missing delivery and billing address Region fields when the order qualifies for update.
Make sure to enable the macro to continue with the Rule Engine configuration.

Note: If the macro is not enabled, it will not appear in the Action value list when setting up the rule.
Go to Orders > Rules engine and click + Add new rule.

Enter the rule name and click Create.

Click Add new, select Condition, set the condition as required, and save it.


Use a condition that identifies orders where address information should be checked and corrected.
Add the macro action and click Save.


In the Add action window, enter the Action name, for example:
Missing Town And Region Fix
-
Set Action type to:
Execute a macro -
In Action value, select:
Missing Town And Region Fix -
Click Save
Note: If the macro is not enabled, it will not appear in the Action value list when setting up the rule.
Review the saved rule setup.

-
Verify the condition and action are connected correctly
-
Click Save in the bottom-right corner to save the rule
Missing Region or Town values can cause address validation issues, especially when external services require complete location information. This macro helps reduce those issues by automatically correcting selected orders.
Reduce Manual Address Checks
Eliminates the need to manually open each selected order and check whether customer address Region or Town fields are missing.
Improve Order Data Quality
Helps keep delivery and billing address information more complete and consistent before fulfilment.
Support Courier Validation
Reduces the chance of address validation problems caused by missing Region or Town data.
Apply a Defined Region
Uses the configured RegionName value to populate missing Region fields.
Update Only Selected Orders
Processes only the order IDs passed into the macro by the rule or selection.
Record Execution Logs
Writes start, validation, update, error, and finish messages to the macro log.
How It Works
The macro checks each selected order and updates missing delivery or billing address fields only when the order qualifies for correction.
Step 1
The macro starts execution and writes Macro Started: Fetching All the Order Id to the log.
Step 2
It checks whether any OrderIds were provided. If no order IDs are provided, the macro logs the issue and stops.
Step 3
It checks whether RegionName has a value. If RegionName is empty, the macro logs that the region name is required and stops.
Step 4
For each selected order, the macro retrieves the order details using the Linnworks Orders API.
Step 5
The macro checks the delivery address. If both delivery Town and Region are already available, the order is marked as already having complete address information.
Step 6
The macro checks the billing address. If both billing Town and Region are already available, the order is also marked as already having complete address information.
Step 7
If either address check marks the order as already complete, the macro skips that order and moves to the next selected order.
Step 8
If the order is not skipped, the macro fills any empty delivery Region field with RegionName.
Step 9
If the delivery Town field is empty, the macro sets it to the delivery Region value.
Step 10
The same checks are applied to the billing address: empty billing Region is filled with RegionName, and empty billing Town is filled using the billing Region value.
Step 11
The macro saves the updated customer information back to the order.
Step 12
The macro logs any errors and writes Macro finished when execution ends.
Usage of App
This macro is designed to update selected orders automatically once the required RegionName parameter is configured. It is useful before dispatch, during order validation, or whenever selected orders need address data cleanup.
OrderIds
Defines the Linnworks order IDs that should be processed. Only these selected orders are checked and updated.
RegionName
Defines the default region value that will be applied when a delivery or billing address has an empty Region field.
Town Update Behaviour
If a Town field is empty, the macro fills it using the relevant address Region value.
Skip Behaviour
If the delivery address already has both Town and Region, or the billing address already has both Town and Region, the macro skips the order.
Execution Logging
The macro records start, validation, skipped order, update, error, and completion messages using the macro logger.
Key Points to Remember
-
The macro processes only the order IDs provided in OrderIds
-
RegionName is required
-
Missing delivery and billing Region values are filled with RegionName
-
Missing delivery and billing Town values are filled using the relevant Region value
-
If either the delivery address or billing address already has both Town and Region, the order is skipped
-
Existing populated address values are not overwritten
-
The macro saves updates using SetOrderCustomerInfo
Once the macro is running, it helps ensure selected orders have the basic address region and town information required for smoother order handling.
What You Can Expect
-
Missing Region values are automatically updated
Empty delivery and billing Region fields are filled using the configured RegionName value.
-
Missing Town values are automatically updated
Empty delivery and billing Town fields are filled using the relevant Region value.
-
Orders with complete address data are skipped
The macro avoids changing orders when address information is already complete based on the configured logic.
-
Execution details are logged
The macro logs start, validation messages, updated orders, errors, and completion.
dummy region name
Use a dummy region name like:
RegionName: England
Other safe dummy examples:
RegionName: London RegionName: Greater London RegionName: Default Region RegionName: United Kingdom
For testing, I would use:
RegionName: Default Region