Courseiva
PDF Automation →hardMultiple Choice

UiPath-ADAv1 PDF Automation Practice Question

A developer automates extraction of purchase order numbers from supplier PDFs. The Read PDF Text activity returns a long string containing the entire document. The developer needs only the value that immediately follows the label "PO Number:" on the same line. Which approach reliably isolates that value for downstream processing?

⚠ Common exam trap

The trap here is assuming a fixed position or line location for the value, when the reliable signal is the label itself and should be matched by pattern.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Use a regular expression with the Matches activity to capture the text after "PO Number:" and read the first match group.

The label "PO Number:" provides a stable anchor within the otherwise variable document text. A regular expression can match that literal and capture the characters that follow on the same line, and the Matches activity exposes the captured group directly. This yields only the desired value, tolerates different placements of the label, and avoids brittle position-based slicing.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Split the extracted string on the newline character and assign the last element to a variable.

    Why it's wrong here

    Taking the last line assumes the purchase order number is always the final line of the document, which is not guaranteed across suppliers with different layouts, headers, or footers. This approach would silently capture an unrelated value when the label appears elsewhere. It does not target the label at all, so it is unreliable for isolating the specific value after "PO Number:".

  • ✗

    Use the Contains method to confirm the label exists, then store the entire extracted string in the output variable.

    Why it's wrong here

    Contains only returns a boolean indicating whether the label is present; it does not extract the value that follows it. Storing the full document string in the output variable leaves downstream steps to parse the whole content again, which defeats the goal of isolating the purchase order number. This approach verifies existence but never performs the required extraction.

  • ✗

    Replace all newline characters with spaces and then take the first fifty characters of the string.

    Why it's wrong here

    Collapsing newlines and truncating by fixed length ignores the label position entirely. Unless the purchase order number happens to sit at that exact offset, the result will contain unrelated text or cut the value short. Different suppliers place the label at different points, so a position-based slice cannot reliably isolate the intended value and would require constant maintenance.

  • ✓

    Use a regular expression with the Matches activity to capture the text after "PO Number:" and read the first match group.

    Why this is correct

    A regular expression can anchor on the literal label and capture the following characters up to the end of the line, returning just the value regardless of where the label appears in the document. The Matches activity returns match objects whose groups expose the captured text, so the developer can assign the first group to a variable for downstream use. This is precise and resilient to layout changes.

About these practice questions

This UiPath-ADAv1 question is part of Courseiva's 285-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official UiPath exam blueprint

This UiPath-ADAv1 practice question is part of Courseiva's free UiPath certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the UiPath-ADAv1 exam.