Extracting eight-digit references with Power Fx MatchAll

AB-410 By islever Editorial Last updated

Short answer

Use MatchAll, the MultipleDigits pattern for the exact eight-digit reference, and Contains; then aggregate the MatchAll Value column with Concat to return all customer references in one string.

Question

HOTSPOT
You are building a canvas app that connects to a third-party system by using a connector.
The third-party system returns customer-specific, eight-digit reference numbers embedded in alphabetic characters of varying length.
You need to create a formula to extract the customer reference numbers in a single string value.
How should you complete the Power Fx formula? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Exhibit: Extracting eight-digit references with Power Fx MatchAll

Key Takeaways

It tests the difference between Match and MatchAll plus the need to enforce exactly eight digits while allowing the match anywhere in the text.

This AB-410 scenario tests extracting every eight-digit customer reference from an alphanumeric string in a canvas app. The correct Power Fx approach uses MatchAll with the exact eight-digit pattern and Contains, then Concat to return one string.

Common mistake: Choosing Match or IsMatch, or using a generic digit pattern, fails because Match returns only the first reference and a loose pattern can capture the wrong numeric run; the question needs every eight-digit reference combined into one output string.

Expert Analysis

Start with the output shape The requirement is not merely to detect a reference; it is to return all customer reference numbers as one string. In Power Fx, Match returns the first match, while MatchAll returns a table of every match. Because the connector's response can contain several eight-digit references surrounded by letters of varying length, the table-returning function is the correct starting point. A boolean function such as IsMatch is even less suitable because it only reports whether a match exists.

Narrow the match to exactly eight digits The reference format is fixed at eight digits, so the pattern must enforce that count, for example \d{8} or [0-9]{8}. A generic single-digit or unrestricted digit-run pattern is risky because it can capture a fragment or a different numeric sequence. If the exhibit presents a named pattern such as MultipleDigits, treat it as the exact-eight-digit numeric pattern required by the scenario, not as permission to match any number of digits. The phrase about alphabetic characters of varying length means the digits are not at a predictable index.

Permit a substring match Use the Contains option. This tells the matcher that the pattern may appear anywhere inside the alphabetic text. BeginsWith or EndsWith would require the reference at the start or end and would fail when the letters before or after the digits vary.

Aggregate the matches MatchAll(...).Value gives a one-column table of matched text. Wrap it in Concat with an empty separator, or a chosen delimiter, to produce a single string value. The learner note listing MatchAll, MultipleDigits and Contains is consistent with this structure: collect all matches, use the exact digit pattern, and allow embedded occurrences.

Exam Strategy

When a canvas-app question asks you to extract every occurrence into one value, look for a table-returning matcher and an aggregator. MatchAll supplies the table of matches, and Concat turns its Value column into text. Then verify that the pattern narrows the match to the stated fixed digit count and that the option permits a substring match. Do not settle for a first-match function or a boolean matcher.

Frequently Asked Questions

Why use MatchAll instead of Match in this formula?

Match returns only the first matching reference, while MatchAll returns every match in the connector response. Concat can then combine the Value column into the single string the question requires.

Does Contains matter when the eight-digit references are embedded in letters?

Yes. Contains allows the pattern to match anywhere inside the alphanumeric text; BeginsWith or EndsWith would fail because the alphabetic prefix and suffix vary.

Should the pattern be an exact eight-digit expression rather than a generic digit run?

Use the exact-eight-digit pattern because the reference format is fixed. A generic digit pattern may capture the wrong sequence or a fragment, especially if other numeric runs appear.

More AB-410 FAQ →

Discussion 1 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 1

  1. exam_upskill 👍 1
    1. MatchAll 2. MultipleDigits 3. Contains

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

← Back to AB-410 Study Guide