Executing Custom Prompts in Canvas Apps

AB-410 By islever Editorial Last updated

Short answer

BC Invoke the prompt directly from app logic and pass user input as parameters to the prompt.

Question

A company builds a canvas app for support agents to enter customer notes and generate a summarized response by using a custom prompt.
The company requires the following functionality built into the prompt:
Generate the summary immediately when the agent selects a button in the app.
Supply current user-entered data to the prompt.
You need to execute the prompt.
Which two actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
  1. Run the prompt through a cloud flow from the button.
  2. Pass user input as parameters to the prompt. Correct Answer
  3. Invoke the prompt directly from app logic. Correct Answer
  4. Publish the prompt for reuse in the environment.
  5. Update the app settings.

Key Takeaways

The question tests the difference between using native canvas functions versus cloud flows for AI prompt execution, highlighting that direct invocation with parameter passing is the standard method for immediate UI-triggered actions.

Learn how to execute custom AI prompts in Microsoft Power Platform canvas apps by invoking them directly via app logic and passing user input as parameters.

Common mistake: Candidates often select Cloud Flows (A) because they associate 'automation' with flows. However, for immediate, button-triggered actions within a canvas app that require passing screen-level controls as inputs, direct app logic invocation is the intended and more efficient pattern.

Expert Analysis

This scenario involves integrating AI capabilities into a canvas app using custom prompts. To execute a prompt and supply it with data, you must leverage the specific integration features provided by Power Platform for canvas apps.

First, regarding how to invoke the prompt, Canvas Apps support direct integration with AI Builder prompts via the AI.Prompt function. This allows developers to call the prompt logic directly from the app's control properties (such as the OnSelect property of a button) or through variables. This eliminates the need for an intermediary cloud flow for simple execution, making option C correct. Option A is incorrect because while cloud flows can trigger prompts, the requirement is to generate the summary "immediately when the agent selects a button" within the app context, which is best handled natively in the canvas app logic for responsiveness and simplicity.

Second, regarding supplying user-entered data, custom prompts require inputs to be mapped to parameters defined in the prompt configuration. In a canvas app, you pass the current user input (e.g., text from a text box) as arguments/parameters to the AI.Prompt function. This ensures the dynamic data entered by the agent is sent to the AI model for summarization. Therefore, option B is correct.

Options D and E are administrative or configuration steps that do not directly constitute the action of executing the prompt with user data in this context. Publishing is a lifecycle step, and updating app settings does not inherently execute the prompt.

Exam Strategy

When designing canvas app solutions involving AI, distinguish between complex background processes and immediate UI interactions. For immediate responses triggered by user controls like buttons, prioritize native canvas functions (like AI.Prompt) over delegating to cloud flows unless there is a specific need for server-side processing or external connectors not supported in the client.

Frequently Asked Questions

Can I use a cloud flow to trigger a prompt in a canvas app?

Yes, but it introduces latency. For immediate button-click responses where data is already on the screen, calling the prompt directly in app logic is faster and simpler.

How do I send data from a text box to a custom prompt?

You reference the text box value (e.g., TextInput1.Text) as an argument or parameter in the AI.Prompt function within your app code.

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
    B. Pass user input as parameters to the prompt. C. Invoke the prompt directly from app logic.

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