Similar to how other m-power applications can be supplied parameters at runtime, the AI Assistant is no exception to this. This documentation will walk through how to pass parameters at runtime to the AI Assistant.
Setup with the AI Assistant
Here’s how that setup with the AI Assistant looks.
1. Data Model
A new parameter called CZIP is defined in the data model, which will serve as the appropriate placeholder to store in this case a zip code parameter:

2. System Prompt
The AI Assistant is this example, is given instructions to verify if a zip code is valid or invalid, but does not need the parameter defined here.
##ROLE
Your role specifically is to take is to take a zip code and verify if that's a valid or not.
##GUIDELINES:
You need to respond ONLY with two options once an address is provided.
Option 1. "valid" if the zip is valid.
Option 2. "invalid" if the zip is invalid or not found.
3. User Prompt
The user prompt will need the parameter defined here, as it done like this:
Zip Code: ${CZIP}
As can be seen, the default variable ${message} has been removed, replaced by the above code. Defining the parameter in the user prompt, allows the chatbot to “see” the zip code as a dynamic value, and appropriately pass a zip code into the substitution.
By removing, default user message substitution, this means chatbot will no longer be utilized interactively via the chat window. Now every time the chatbot is invoked it will send this as the message:
Zip Code: VALUE
If an application that calls my AI Assistant ends up passing a zip code value of 60107 to it, then the message to the assistant evaluates as:
Zip Code: 60107
Calling your AI Assistant via a URL
When testing m-Power applications, passing parameters via the URL is common tactic to visually see what results are coming back. In situation where the AI Assistant chatbot is not ran interactively, but rather invoked as workflow behind-the-scenes, it can be called via a URL for testing purposes to confirm the response coming back.
To test the response from any AI Assistant, append the append the chat=1 parameter to the URL, along with a value for my zip code field, CZIP.
.../mrcjava/servlet/ESPINDOLA_AI.I00070s?slnk=1&chat=1&CZIP=60107
When a valid zip code is passed, I see the returned response from the chatbot is “valid”.

When an invalid zip code is passed, the chatbot’s returned response is “invalid”:

At this point, this AI Assistant is ready to accept a value for a zip code when it’s invoked. To see an example of how this parameter would be utilized, continue reading the Real-world application section.
Real-world application
I have a Data List with Web Form that allows new customers to be entered. When a customer is entered, the zip code associated to their address will be verified by the AI Assistant as valid or invalid. The workflow in totality is as follows:
- The customer maintainer form is submitted
- The Workflow Designer within the customer maintainer looks up the AI Assistant, passing the entered zip code.
- The AI Assistant retrieval returns a result of “invalid” or “valid” depending on if the zip code is valid.
- If the AI Assistant returns “invalid”, then a workflow condition is utilized to throw an error message back to a web form.
Workflow Designer (maintainer)
The AI Assistant retrieval, is called via the “Call AI Assistant” action and importantly maps the zip code from the maintainer form, to the zip code parameter in the chatbot (refer to Figure 2).

The AI Assistant’s system prompt was instructed to return ‘invalid’ if the zip code is not a valid zip code.
This means after the AI Assistant call, a condition that checks the assistant response follows:

At runtime, an invalid zip code is passed and the form returns an error message:
