Suggest Ask Oracle questions and look up check values¶
In the Supplier Review Workspace, Ask Oracle suggests questions about the selected supplier. A starter such as What is the status of #{check}? lets the user choose one of that supplier’s checks before submitting the question.
Starter and lookup workflows¶
flowchart TD
subgraph Starters["Supplier Query Options"]
Request([InitSampleQueries]) --> Load["Code · Load the selected supplier"]
Load --> Build["Code · Build questions for this supplier"]
Build --> Suggestions([Return starter query categories])
end
subgraph Checks["Supplier Checks"]
Lookup([QueryFilterValues]) --> Supplier["Code · Load the selected supplier"]
Supplier --> Find["Code · Match check names to the search"]
Find --> Values([Return matching check names as JSON])
end
Configure the workflows¶
Both workflows load the supplier by reading $context.$app.$OraAppContext and matching the ID against the shared fictional records.
| Workflow and message hint | What to return |
|---|---|
DEMO_SUPPLIER_QUERY_OPTIONS · InitSampleQueries |
A JSON object keyed by category ID. Use the selected supplier’s name in the suggested questions. Include the #{check} placeholder when the supplier has checks. Return {} if there is no matching supplier. |
DEMO_SUPPLIER_CHECKS · QueryFilterValues |
A JSON array of check names for the selected supplier. Read categoryId and searchString from $context.$app.$OraQueryFilter. For the check category, match by prefix without regard to case. An empty search returns all checks for the supplier. Return [] for an unknown category, missing supplier, or no matches. |
Enable Expose to Agentic Apps and publish both workflows before selecting them in App Builder. Accept an object or parse a JSON string from $OraQueryFilter in the lookup Code node. Set the lookup Return Value to {{JSON.stringify($context.$nodes.FIND_CHECK_VALUES.$output.result)}}.
Sample starter queries for Northstar Industrial
{
"supplierChecks": {
"displayName": "Supplier review",
"samples": [
"What is the current status of Northstar Industrial?",
"Which checks are incomplete for Northstar Industrial?",
"What is the status of #{check}?"
]
}
}
Sample filter request
With Northstar selected, the response is ["Insurance certificate"].
Configure Ask Oracle in App Builder¶
- Open the app’s Ask Oracle settings. Under Starter Queries, choose Dynamic and set Starter Queries Agent to Supplier Query Options.
- Assign Supplier Checks to the Checks section so it can supply values for the query filter.
- Under Query Filters, select Add. Set Category ID to
check, Display Name to Supplier check, and Workflow to Supplier Checks. Select Done. The category ID matches the placeholder in the starter query. - Keep Custom Query Agent Code set to
DEMO_SUPPLIER_QUERY. This workflow receives the submitted question and answers it using the selected supplier record.
Run the example in Preview¶
| Step | Expected result |
|---|---|
| Select Northstar Industrial and open Ask Oracle. | The starter queries include questions about Northstar. |
| Select What is the status of Supplier check? and open the Supplier check placeholder. | The picker shows Insurance certificate and Bank details. You can also open the filter by typing # while composing a question. |
Type ins, select Insurance certificate, then submit. |
Only Insurance certificate matches the search. Ask Oracle reports that it is missing. |
| Switch to Harbor Office Supply and open the same filter with an empty search. | The questions refer to Harbor and the filter offers Tax registration. |
Search for ins while Harbor remains selected. |
The lookup returns no matches. |
| Select Tax registration for Harbor and submit. | Ask Oracle reports that the check is pending. |
See Starter Queries and Query Value Filters for the response contracts and picker behavior.