MSBA-259 · Lesson 7 of 12 · 21 min

Domain review: prompts and models in AI Hub

▶ Video coming soon A video version of this lesson is on the way.

This was the session Rupert had been waiting for. His baseline practice assessment had shown that AI Hub was his weakest area, and he suspected many experienced makers would be in the same position. Signe opened with the three prompts Lumenvale had built during the autumn: Maribeth's Classify finance email prompt, which sorts messages arriving in the accounts payable mailbox; Triage Work Request, which reads a facilities request and returns a category, priority and short summary as JSON; and Describe Fault, which drafts a description from a technician's photo. All three appear in the earlier courses, and together they cover most of what this skill area tests.

The skill area is called Create prompts and models in AI Hub, and the study guide lists eight skills: build prompts from templates or from blank; consume a prompt in apps; consume a prompt in cloud flows; add knowledge to a prompt; customize prompt settings, including models; add inputs to a prompt; consume an AI model in apps; and consume an AI model in cloud flows. Half are about prompts, two about AI models, and two about where both are used.

What AI Hub is

AI Hub is the area in Power Apps and Power Automate where makers create, test and manage prompts and AI models. Many older tutorials call these capabilities AI Builder, and the AI Builder connector and actions still appear in Power Automate. The outline uses AI Hub language, and the exam will too. Two kinds of asset live there:

Prompts and AI models in AI Hub.
PromptAI model
What it isInstructions to a generative AI model, with inputs, optional knowledge and settingsA model trained for a specific task, either prebuilt or custom
OutputText, or structured JSON if configuredStructured results specific to the model, with confidence scores
Examples at LumenvaleClassify finance email, Triage Work Request, Describe FaultPrebuilt invoice processing for supplier invoices; a custom document processing model for trades invoices
How you improve itEdit the instructions, inputs, knowledge or settings and retestUse better training documents, retrain and republish (custom models)

Building prompts

A prompt can be built from a template, which provides a starting set of instructions for a common task such as summarizing text, classifying it or extracting information, or from blank, where the maker writes the instructions. In either case the prompt builder lets the maker write instructions in plain language, insert inputs and knowledge into the text, choose settings, and test with sample values before saving.

Good prompt instructions are specific. Maribeth's first version of Classify finance email said "Classify this email." It returned inconsistent labels. Her final version listed the five categories accounts payable used, defined each in one sentence, said what to return when none applied, and required a one-word answer. Precision in the instructions improved accuracy more than any setting did.

A prompt with two text inputs, Subject and Body, shown here in square brackets.
Instructions (Classify finance email):
You help Lumenvale's accounts payable team sort incoming email.
Read the email subject [Subject] and body [Body].
Return exactly one of these labels:
- Invoice: a supplier invoice or a corrected invoice is attached or included.
- Statement: a statement of account listing several invoices.
- Remittance: notice that a payment has been made or received.
- Query: a supplier or staff member is asking about a payment or invoice.
- Other: anything else.
Return only the label, with no other words.

Adding inputs

Inputs are the variables a prompt receives each time it runs. Text inputs are the most common; prompts can also accept images and documents, which is how Describe Fault reads a technician's photo. Each input has a name and sample data used for testing in the builder. When the prompt is used in an app or flow, each input is supplied by a value from the app or a dynamic value from an earlier flow step. Questions may ask how to make a prompt reusable across different records: by using inputs rather than hard-coding values in the instructions.

Adding knowledge

Knowledge grounds the prompt in organizational data. A prompt can use data from Dataverse tables, with filters, so that the model answers using current records. Triage Work Request, for example, uses the Building table as knowledge so that it can recognize building names and codes in a request and return the right building. Knowledge is not the same as an input: an input is a value passed in each time, while knowledge is data the prompt retrieves when it runs. The prompt only sees knowledge the running user or flow is allowed to read, and settings such as how many records to retrieve affect both quality and cost.

Customizing prompt settings and models

Prompt settings include the model that runs the prompt, a temperature or creativity setting that trades consistency for variety, the output format (text or JSON), and settings for knowledge retrieval. AI Hub offers more than one model, typically a default model suitable for most tasks and more capable models for harder reasoning that consume more capacity. Model names and options change often, so the exam is more likely to ask when to choose a more capable model, or a lower temperature, than to ask for a model's exact name.

A lower temperature makes outputs more consistent, which suits classification and extraction. A higher temperature suits drafting text where variety is welcome. JSON output suits prompts whose results are used by flows and apps, because each value can be read separately. Triage Work Request returns JSON with category, priority and summary properties, which the assignment flow reads directly.

A diagram of a prompt. On the left, inputs Subject and Body flow into a central box labeled Instructions. Above it, a Knowledge box shows the Building table. Below it, a Settings box lists Model, Temperature and Output format JSON. On the right, the output JSON with category, priority and summary flows to a canvas app and a cloud flow.
The parts of a prompt: inputs, instructions, knowledge, settings and output, consumed by apps and flows.

Consuming a prompt in apps

In a canvas app, a prompt is added as a data source and called with its Predict function, passing the inputs. The result's text property holds the response; when the prompt returns JSON, the app can parse it with ParseJSON and read individual values. Calls should run when the user acts, such as pressing a button, not on every screen load, because each call consumes capacity and takes time.

Calling a prompt from a canvas app and reading a value from its JSON output. Check the current documentation for the exact call pattern for prompts with several inputs.
// OnSelect of the Triage button in a canvas app
Set(varTriage, 'Triage Work Request'.Predict(txtRequest.Text));
Set(varResult, ParseJSON(varTriage.text));
Notify("Suggested priority: " & Text(varResult.priority), NotificationType.Information);

In model-driven apps, prompts are most often used through prompt columns, covered in lesson 4, or through flows that write results to Dataverse. A prompt column runs the prompt automatically when a row is created or its inputs change and stores the result.

Consuming a prompt in cloud flows

In Power Automate, the AI Builder action that runs a prompt lets a flow select a prompt from AI Hub, map each input to dynamic content, and read the response in later steps. The Finance Invoices intake flow runs Classify finance email for each new message and uses a Switch on the returned label to decide what happens next. When the prompt returns JSON, the flow uses Parse JSON or expressions to read each property.

Flows that use prompts should handle uncertainty. If the label is not one of the expected values, or a JSON property is missing, the flow should route the item for human review rather than guessing. Lumenvale's rule is that a prompt can draft and suggest, but a person confirms anything that commits the college to a payment or a priority.

AI models

AI models in AI Hub come in two kinds. Prebuilt models are ready to use: examples include invoice processing, receipt processing, identity document reading, text recognition, sentiment analysis, language detection, key phrase extraction, entity extraction and category classification. Custom models are trained on the organization's own examples, such as document processing for a particular form layout, object detection for recognizing items in photos, prediction based on Dataverse history, and custom classification or entity extraction.

The exam's skills are about consuming models, not training them in depth, but you should know when a prebuilt model is enough and when a custom model is needed. Supplier invoices in common formats suit the prebuilt invoice model. The Lakeshore trades suppliers' handwritten or unusual invoices did not, so the finance office trained a custom document processing model for them.

Consuming an AI model in apps and flows

In cloud flows, AI Builder actions such as extracting information from invoices, or running a custom model, return fields with confidence scores. The Finance Invoices extract flow compared each confidence score with a threshold, 0.80 at Lumenvale, stored in an environment variable so that it could be adjusted; anything lower was routed for review. That pattern, confidence threshold plus human review, is the safe answer whenever a question mentions accuracy requirements.

In canvas apps, models are used through AI components, such as controls that read business cards, receipts or forms, or through Power Fx functions available for some prebuilt models. A question might describe a technician photographing a receipt for parts bought at a store: a receipt processing component in the canvas app is the direct answer.

Licensing and responsible use

Prompts and AI models consume capacity. Since November 1, 2026, AI Builder credit add-ons have reached end of life and Copilot Credits are the currency for new consumption, with any remaining AI Builder credits used first. When neither is available, AI features stop working. For the exam, the practical points are that AI usage has a cost, that flows and apps should call prompts only when needed, and that administrators monitor consumption.

Responsible use is part of every AI scenario. Generated outputs can be wrong, so builders test with realistic samples, add human review for consequential decisions, avoid sending more personal data to a prompt than the task needs, and remember that text in an input, such as an email body, could contain instructions intended to manipulate the model. A classification prompt that only returns one of five labels is much safer against such text than a prompt that composes a reply and sends it automatically.

Worked problem

Choosing between a prompt and a model

Three facilities requirements: (1) Read a supplier's standard invoice PDF and extract the invoice number, date, total and supplier name. (2) Read free-text work requests and decide whether each is Plumbing, Electrical, Grounds, Cleaning or Other. (3) Detect whether a photo of a fire extinguisher shows the inspection tag, trained on Lumenvale's own photos. What would you use for each, and where?

Show solution
  1. (1) Standard invoice fields: the prebuilt invoice processing model, consumed in a cloud flow, with a confidence threshold and review.
  2. (2) Free-text classification into the organization's own categories: a prompt with clear instructions and a fixed list of labels, consumed in the flow or as a prompt column. A custom category classification model is an alternative when there are many labeled examples.
  3. (3) Recognizing a specific object in photos: a custom object detection model trained on Lumenvale's photos, consumed in the Field Tech canvas app or in a flow.

Answer: Prebuilt invoice processing for (1), a prompt for (2), and a custom object detection model for (3).

Testing prompts before you rely on them

Every prompt in the circle's examples was tested before use, and the testing itself is a likely subject for exam scenarios. The prompt builder lets you run a prompt against sample inputs and see the response, so a maker can try typical cases, unusual ones and deliberately awkward ones before saving. Facilities tested Triage Work Request with thirty real requests that had already been categorized by hand; it matched the human category on 27 and the human priority on 29. They then examined the misses, tightened the instructions for two categories that overlapped, and retested on a larger set of sixty, matching 54.

That approach generalizes. Build a small test set with known answers, measure the prompt against it, change one thing at a time, and retest. Keep the test set so that any later change to the instructions, model or settings can be checked the same way. If a question asks how to confirm that a change to a prompt has not made it worse, rerunning a known test set is the answer.

Where AI Hub ends and Copilot Studio begins

Candidates sometimes confuse prompts with agents. A prompt performs one task when it is called: classify this text, summarize this record, describe this photo. An agent in Copilot Studio holds a conversation, decides which tools and knowledge to use and may take several steps. AB-410 tests prompts and models in AI Hub in depth and agents more lightly, through evaluating built-in agents and creating an agent from a canvas app. When a requirement describes a single, repeatable transformation inside an app or flow, think prompt. When it describes a person asking open questions or an assistant that acts across steps, think agent.

Common mistakes

  • MistakeHard-coding a record's values into prompt instructions.

    InsteadUse inputs for values that change with each run.

  • MistakeConfusing knowledge with inputs.

    InsteadInputs are passed in each time; knowledge is organizational data the prompt retrieves when it runs.

  • MistakeUsing a high temperature for classification.

    InsteadUse a low temperature and a fixed list of labels for consistent results.

  • MistakeActing automatically on low-confidence model results.

    InsteadCompare confidence with a threshold and route uncertain items for human review.

  • MistakeCalling a prompt every time a screen loads.

    InsteadCall it when the user acts, because every call consumes capacity.

Summary and key terms

  • AI Hub holds prompts and AI models; the outline uses AI Hub language even though AI Builder actions remain in Power Automate.
  • Prompts are built from templates or blank, with inputs, optional Dataverse knowledge and settings including the model, temperature and output format.
  • Canvas apps call prompts with Predict; flows run prompts with an AI Builder action; prompt columns use prompts in Dataverse.
  • Prebuilt models cover common tasks such as invoices and receipts; custom models are trained on the organization's examples.
  • Use confidence thresholds and human review for model outputs.
  • AI usage consumes Copilot Credits after November 1, 2026; call prompts only when needed and design for responsible use.
Prompt
Instructions to a generative AI model, with inputs, optional knowledge and settings, stored in AI Hub.
Input
A value passed to a prompt each time it runs.
Knowledge
Organizational data, such as Dataverse rows, that a prompt retrieves to ground its answer.
Temperature
A setting that controls how varied or consistent a model's outputs are.
Prebuilt model
A ready-to-use AI model for a common task, such as invoice processing.
Confidence score
A value between 0 and 1 that indicates how sure a model is about an extracted value.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. A prompt must return a category and a priority that a flow reads separately. Which output format should you choose?

    Show answer

    JSON.

  2. Which function calls a prompt from a canvas app?

    Show answer

    Predict, on the prompt added as a data source.

  3. Invoices from most suppliers are standard, but one supplier uses an unusual handwritten layout. What do you use for that supplier?

    Show answer

    A custom document processing model trained on that supplier's invoices.

  4. Why might email text passed to a prompt be a risk?

    Show answer

    It can contain instructions meant to manipulate the model, so limit what the prompt can do and review its outputs.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz