Search HoldMyTwist

Make Text parser: extract order IDs and catch no matches

Extract a labelled order ID in Make Free, handle no matches with a review marker, and check multiple IDs before adding a real destination.

A brass magnifying glass isolates a gold tag on an order slip beside a navy review tray.

Make's Text parser can pull an order reference out of a predictable notification. The catch is what happens when the notification changes: the run can finish without a match, and the next module may never run.

This practice scenario extracts ORD-1042, rejects a five-digit example and produces REVIEW INPUT when nothing matches. We ran it in a Make Free account with fictional text, then checked the actual outputs and repeated runs. It does not connect an inbox or write to a spreadsheet.

Before you start

You need a Make account with credits available. The Free plan (opens in a new tab) is enough for this manual exercise. Keep the scenario Inactive and use Run once. No AI module, paid trial or external app connection is required.

If you want to try the same example, create a Make account and choose Free (opens in a new tab). This is an affiliate link. We may earn a commission if you later buy through our link, at no extra cost to you.

Use this approach when the source has a stable label and ID format. If your app already provides an order-ID field, use that field. For a handful of messages, copying the reference yourself may take less work than maintaining a pattern.

1. Extract one order ID

  1. In Make, open Scenarios and choose Create a new scenario. Name it Order reference practice.
  2. Add Text parser and select Match pattern. Use the regular module for this exercise.
  3. Paste this into Pattern, without surrounding slashes:
Text to copy

Order ID:[ \t]*(?<orderId>ORD-[0-9]{4})\b

The label is Order ID:. [ \t]* allows spaces or tabs after it. The named capture group orderId captures an ID made of ORD- followed by four digits. The final \b stops this example from taking the first four digits of ORD-10421.

  1. Set Global match to No, Case sensitive to Yes, Multiline to No and Singleline to No.
  2. Leave Continue the execution of the route even if the module finds no matches set to No for the first test.
  3. Paste the fictional notification below into Text.

Make Text parser pattern with named orderId group, Global match No and Case sensitive Yes.

Make Text parser pattern with named orderId group, Global match No and Case sensitive Yes.
Open full-size image
Text to copy

Order confirmation
Order ID: ORD-1042
Items: 2
Tracking: TRK-7788

Make Text parser input with fictional order ORD-1042 and no-match continuation set to No.

Make Text parser input with fictional order ORD-1042 and no-match continuation set to No.
Open full-size image
  1. Click the module's Save, then the canvas Save. Keep scheduling Inactive.
  2. Click Run once. If Make warns that the last module's data is unused, proceed with this practice run. Click the small numbered execution bubble above Text parser and expand Operation 1.

Under Output, expect orderId: ORD-1042. The item count and tracking number should stay out of that output. In our run, the named field contained exactly that reference.

The parser extracts ORD-1042 and leaves the other numbers out.

Make Text parser output contains orderId ORD-1042 from the fictional order text.

Make Text parser output contains orderId ORD-1042 from the fictional order text.

The parser extracts ORD-1042 and leaves the other numbers out.

Open full-size image

A capture group is the part in parentheses that becomes an output field. Make documents capture groups and the Global match switch in its Text parser help (opens in a new tab).

2. Add a visible result

  1. Close the execution panel. Click the plus to the right of Text parser, add Tools and select Set variable.
  2. Set Variable name to result.
  3. In Variable value, enter the expression below. In this scenario Text parser is module 1. If yours has another number, map its orderId output instead.
Text to copy

{{ifempty(1.orderId; "REVIEW INPUT")}}

The editor should show orderId as a mapped token inside ifempty. Make's general functions reference (opens in a new tab) defines this function as using the second value when the first is empty.

Make Tools Set variable maps orderId through ifempty into a result field.

Make Tools Set variable maps orderId through ifempty into a result field.
Open full-size image
  1. Save the module and scenario, then Run once again.
  2. Open Tools' numbered bubble. Under Output, check result: ORD-1042.

Watch out

A fallback expression can only help when its module runs. Test a nonmatching message before connecting a destination. With continuation off, our Tools module never ran; with it on, the same input produced REVIEW INPUT. If you see REVIEW INPUT, inspect the notification before any later step writes an order record.

3. Catch a message that does not match

  1. Open Text parser. Replace Text with this deliberately wrong five-digit reference:
Text to copy

Order confirmation
Order ID: ORD-10421
Items: 2

  1. Keep the no-match continuation switch at No. Save the module and scenario, then Run once.
  2. Inspect the execution. Our parser had no extracted output, and Tools had no execution bubble. A completed run did not mean we had an order ID.
With continuation off, the no-match test leaves Tools without an execution.

The parser runs without a match and the downstream Tools module has no operation.

The parser runs without a match and the downstream Tools module has no operation.

With continuation off, the no-match test leaves Tools without an execution.

Open full-size image
  1. Open Text parser again. Set Continue the execution of the route even if the module finds no matches to Yes. Keep the same five-digit input, save and Run once.
Turn continuation on while keeping the same five-digit test input.

Make Text parser continuation set to Yes with the deliberately wrong five-digit order ID.

Make Text parser continuation set to Yes with the deliberately wrong five-digit order ID.

Turn continuation on while keeping the same five-digit test input.

Open full-size image
  1. Open Tools' execution bubble. Expect result: REVIEW INPUT.
  2. Run once again without changing the input. We got the same marker.
  3. Restore the original four-line notification from step 1, save and rerun. We checked that Tools returned ORD-1042 again.
Before correcting the text, the no-match run produces REVIEW INPUT.

Make Tools output contains REVIEW INPUT after the parser finds no match.

Make Tools output contains REVIEW INPUT after the parser finds no match.

Before correcting the text, the no-match run produces REVIEW INPUT.

Open full-size image

We also tried Order reference: ORD-1042. Because the label no longer matched, Tools returned REVIEW INPUT. Treat the marker as a request to inspect the source. This two-module exercise does not add a review queue or prevent a later destination from writing it.

4. Check whether one message has several IDs

  1. Replace Text with two labelled references:
Text to copy

Order ID: ORD-1042
Order ID: ORD-2057

  1. With Global match set to No, save and run. Our Tools output contained only ORD-1042.
  2. Change Global match to Yes, save and run. Open Tools' execution bubble and expand both operations.

We got two operations, one with ORD-1042 and one with ORD-2057. A bundle is one set of data passed along the route. Global match emits a separate bundle for each match, so the downstream module can run more than once.

With Global match on, Operation 2 contains the second reference, ORD-2057.

Make Tools Operation 2 outputs ORD-2057 when Global match is Yes.

Make Tools Operation 2 outputs ORD-2057 when Global match is Yes.

With Global match on, Operation 2 contains the second reference, ORD-2057.

Open full-size image

Repeating that run produced both IDs again. Text extraction does not remember which orders you already processed. Before adding a module that creates or updates records, decide how to handle repeated notifications and quoted older messages. Our Data Store duplicate-check guide covers one separate practice for remembered IDs.

For the single-order exercise, restore the original notification, set Global match back to No and leave the scenario Inactive.

If you need all matches in one output

A Set variable module runs once for each bundle it receives. It does not collect the matches into one result. To practise combining matches, restore the two-ID sample above and set Global match to Yes. Keep scheduling Inactive. Choose what the next step needs:

  • To keep every matched record in a list, use an Array aggregator. Choose Text parser as Source Module and include orderId in Aggregated fields. The linked guide shows source selection and output inspection.
  • To build one readable text value, use a Text aggregator. Its text template and row separator control the summary.

Named fields are a different output shape. Make's toCollection function (opens in a new tab) converts an array of key/value objects into a collection. That needs a different capture pattern from the order-ID example above.

Check for repeated labels before that conversion. In a separate fictional test, Name: River followed by Name: Cedar left only Name: Cedar in the collection. Keep repeated entries in an array if you need all their values.

Retest a message with no matches after adding an aggregator. By default, an empty aggregation can still produce output and run the next module. For Array aggregator, check Stop processing after an empty aggregation before connecting a destination.

When the pattern needs changing

This pattern assumes the exact label Order ID:, uppercase ORD- and four digits. Different labels, extra digits or a changed format need a deliberate revision. Case sensitive Yes also makes letter case matter. Test the revised pattern with examples of the notifications your app actually sends before relying on the result.

The pattern searches for matching text. It does not validate the whole message or confirm that an order exists. HTML markup, replies containing older IDs and punctuation around references can need additional handling. We tested pasted plain text here; receiving real email and writing records are separate tasks.

If you see no output, compare Text with the label and ID format, then check the continuation setting. If you changed the pattern and get an empty output bundle, check that it still contains a capture group. In this example, that's (?<orderId>ORD-[0-9]{4}). Make's documentation (opens in a new tab) says Match pattern returns an empty output bundle when the pattern has no capture groups. If orderId is missing from the mapper, first run the parser with the valid sample and confirm its Output. If Tools shows the expression as ordinary text, check that the output is a mapped token and that the function is inside the expression braces.

To practise extracting an order ID and checking a no-match result, start with Make Free (opens in a new tab) and use the fictional notification above. Keep the scenario inactive; writing order records needs its own duplicate checks.

Sources: Make Text parser (opens in a new tab), Make general functions (opens in a new tab) and Make pricing (opens in a new tab).

Share this guide