Skip to main content
This page describes Step 3 of Tags Sync: synchronising Dimension Values from the Accounting System with Tags in Pleo, for each synced Dimension-Tag Group pair. This step runs immediately after Tag Group synchronisation, for every active Tag Group-Dimension pair.

Implementation

Conceptual Model

Tag synchronisation keeps the Tags within each Tag Group aligned with the Dimension Values of the corresponding Dimension.
AS EntityPleo Entity
Dimension ValueTag
Dimension Value codeTag code
Dimension Value nameTag name
The Accounting System is the source of truth. Pleo Tags are updated to reflect the current active Dimension Values.

Sync Process

1. Pull Dimension Values

For each synced Dimension-Tag Group pair, retrieve active (non-blocked, non-expired) Dimension Values from the AS.

2. Pull Tags from Pleo

Retrieve active and archived Tags for the corresponding Tag Group from Pleo.

3. Match Dimension Values to Tags

For every Dimension Value, match against Tags using the Dimension Value’s code (case-insensitive).

Code found — Tag is active

The AS Dimension Value is active and the matching Pleo Tag is also active. Preserve it. If the Tag’s name differs from the Dimension Value name, update the Tag’s name to match.

Code found — Tag is archived

The AS Dimension Value is active but the matching Pleo Tag is archived. Unarchive it. If the Tag’s name differs from the Dimension Value name, update the Tag’s name to match.

Code not found

The AS Dimension Value is active but no matching Pleo Tag exists. Create a new Tag with the Dimension Value’s code and name.

Duplicate codes found

Two or more Tags in Pleo share the same code. Apply the following resolution logic:
  1. Check whether any of the duplicates also match the Dimension Value by name.
  2. If a name match exists: retain that Tag, archive all other duplicates.
  3. If no name match exists, or multiple name matches exist: retain one Tag (chosen randomly), update its name to match the Dimension Value, and archive all other duplicates.

4. Archive unmatched Tags

Pleo Tags that are active but have no matching active AS Dimension Value must be archived. This covers Tags corresponding to Dimension Values that have been deleted, blocked, expired, or deactivated in the AS.

Matching Rules

  • Matching is performed using the code field on both ends.
  • Matching is case-insensitive: a Dimension Value with code ENG matches a Tag with code eng.
  • Name differences do not affect matching; only code is used for matching. Names are updated separately if they differ.

What Comes Next?