Replace XML and JSON Tag References Within Patterns and Rearranges
    • 02 Jul 2025
    • 2 Minutes to read
    • Contributors
    • PDF

    Replace XML and JSON Tag References Within Patterns and Rearranges

    • PDF

    Article summary

    Applies to: Lasernet 11 and Lasernet Essentials / Professional / Advanced

    If the structure of the XML or JSON data (that a form processes) changes, you might need to change the form’s patterns and rearranges to refer to differently-named XML or JSON tags.

    Example

    The StatementDetail pattern (see the upper panel on the left side of the image below) refers to the DeliveryData/StatementEntries/StatementEntryDetail tag in the incoming XML data.

    The two selected rearranges (see the lower panel on the left side), which are within the selected StatementDetail pattern, refer to data in the TransactionDescription tag (in the incoming XML data).

    These tag references were correct when the form was designed. However, the structure of the incoming XML has changed:

    • StatementEntryDetail is now StatementDetail

    • TransactionDescription is now Description

    The loaded grab file (see the center panel) is an example of the new XML structure, which uses the new tag names. Because the XML structure has changed, the selected pattern and rearranges no longer correspond to any tags within the XML. As a result, the XML does not contain highlighted lines that show which data the pattern and its rearranges are linked to.

    A screenshot of patterns and rearranges that do not link to tags in displayed XML data

    You can use the Replace tag name window to find and replace text within patterns’ and rearranges’ tag references.

    A screenshot of patterns and rearranges that do not link to tags in displayed XML data and the Replace Tag Name window with values entered

    In this example, this action has corrected the tag reference for the StatementDetail pattern.

    A screenshot of patterns and rearranges where the pattern links to a tag in the displayed XML data

    You could repeat this action in the lower panel to correct the tag reference for the transaction description rearranges.

    Steps

    To replace XML and JSON tag references within patterns and rearranges, follow these steps:

    1. In the Form Editor, click the View menu and then click Patterns. The Patterns panel opens to the left of the data area where the Form Editor displays grab files.

    2. Your next step depends on whether you want to replace references in patterns or rearranges:

      • Patterns: In the upper area of the Patterns panel, right-click Sheet or a listed pattern, then click Replace tag name.

        The mouse pointer over the Replace tag name menu item for a form pattern

      • Rearranges

        • If you want to modify rearranges that are not part of a pattern:

          1. In the upper area of the Patterns panel, click Sheet. The lower area of the panel lists rearranges that are not part of a pattern.

          2. Right-click a rearrange in the lower area of the Patterns panel.

          3. Click Replace tag name.  

        • If you want to modify rearranges that are part of a pattern:

          1. In the upper area of the Patterns panel, click the pattern that contains those rearranges. The lower area of the panel lists rearranges that are part of that pattern.

          2. Right-click a rearrange in the lower area of the Patterns panel.

          3. Click Replace tag name.

          The mouse pointer over the Replace tag name menu item for a rearrange that is part of a pattern

    3. In the Replace tag name window:

      • Use the Find what box to specify the tag text that you want to search for.

      • Use the Replace with box to specify the text you want to replace it with.

      • Select Match whole word and Match case if necessary.

      • Click Find Next to search for the next occurrence of the specified tag text.

      • Click Replace to replace the occurrence of the specified tag text in the currently selected pattern or rearrange. After doing so, Lasernet finds the next occurrence.

      • Click Replace All to replace all occurrences.

      • Use the Direction options (Up and Down) to specify which direction to search in (in the list of patterns in the upper area and the list of rearranges in the lower area).

    4. Click Close. Your changes are applied in the Form Editor window.