Sibling Match Criteria

The Sibling Match feature lets you unprotect a value only when a nearby element matches context you define, such as label text, element type, direction, or attribute values. Instead of unprotecting every selector match on the page, it adds a nearby-context check so the same selector can be safely reused in different UI sections.

Overview

Sibling matching is configured through siblingMatchCriteria on a mapping entry. It is a context filter: your primary mapping still finds candidate elements, and siblingMatchCriteria decides whether each candidate should be unprotected based on what appears near it.

Use it when:

  • The same target element pattern appears in multiple places on a page
  • Only one section should be unprotected
  • A nearby label or marker identifies the correct context

How to Think About It

Treat it as an “anchor” check:

  1. The mapping finds a candidate target element.
  2. The feature looks around that target for a nearby element that matches your criteria.
  3. If a match is found, the target is unprotected.
  4. If no match is found, that target is skipped.

This keeps rules precise without requiring fragile or overly specific selectors.

siblingMatchCriteria Fields

  • labelText (optional) — Text that should appear on the nearby anchor element.
  • elementType (optional) — Expected tag name of the anchor element (for example, label, div, span).
  • attributeName (optional) — Attribute that must exist on the anchor element.
  • attributeValue (optional) — Optional expected value for attributeName.
  • direction (optional) — Where to look relative to the target (left or right).
  • distance (optional) — How far the search can expand through nearby structure.

If you provide multiple fields, they are treated as one combined match. In other words, the same nearby element must satisfy all specified criteria.

HTML Matching Example

Example target and nearby context:

<div class="field-row">
  <div title="Account Name">Account Name</div>
  <a data-special-link="true">PTY:93f2a1...</a>
</div>

Example mapping entry:

{
  "targetElement": "a",
  "attributeName": "data-special-link",
  "attributeValue": "true",
  "entries": [
    {
      "dataElement": "deName",
      "operation": "unprotect",
      "siblingMatchCriteria": {
        "labelText": "Account Name",
        "elementType": "div",
        "attributeName": "title",
        "attributeValue": "Account Name",
        "direction": "left",
        "distance": 2
      }
    }
  ]
}

In this example, the link is only unprotected when the matching context element (<div title="Account Name">) is present on the left. The same a[data-special-link="true"] elsewhere on the page will be skipped if that context is missing.

Additional Example: Right-Side Match

<div class="field-row">
  <span class="value" data-tokenized="true">PTY:0ab123...</span>
  <span data-role="field-label">Phone</span>
</div>
{
  "targetElement": "span",
  "attributeName": "data-tokenized",
  "attributeValue": "true",
  "entries": [
    {
      "dataElement": "dePhone",
      "operation": "unprotect",
      "siblingMatchCriteria": {
        "labelText": "Phone",
        "attributeName": "data-role",
        "attributeValue": "field-label",
        "direction": "right"
      }
    }
  ]
}

This configuration only unprotects tokenized values when the matching “Phone” label is found to the right.


Last modified : July 30, 2026