To-do List Query
Add search to the to-do list by creating a MongoDB Query, exposing it as an API through a Saga, and wiring the UI lister to use the query endpoint with a filter.
This exercise adds a simple search flow on top of the to-do list. You will:
define a Query that filters todos by
data.projectexpose it as an API using a Saga
update the UI lister to call the query endpoint and show filtered results
Before you start
You completed To-do List UI.
You know your API base URL:
https://[YOUR_ADMIN_API_DOMAIN].
What you’ll build
Query ID:
todoFilters
data.project = %%project%%
Saga path:
/SearchTodosAPI endpoint:
GET https://[YOUR_ADMIN_API_DOMAIN]/api/request/rpc/SearchTodos?project=PersonalSource update: add
query -> request/rpc/SearchTodosUI update: switch lister to Query Table and add a
projectfilter
Open the Query screen
Open the Query screen from the Configuration app.
Unless you changed routing, the UI is at https://[YOUR_ADMIN_UI_DOMAIN]/app/configuration/common/query.

Open the Saga screen
Open the Saga screen from the Devops app.
If you need a refresher on the basics, follow the structure in Exercise: Hello World API.
Configure the Event step (GetQuery)
Edit the Event step:

DEFINITION
Step Name:
Get Project Todos
EVENT META
Event Version:
0Event Action:
GetQueryEvent Domain:
masterInput Element:
parametersOutput Element:
$Parameters Map
Key:
queryIdValue:
todo
This step executes GetQuery against the master system, using the Query ID todo.
It reads query parameters from parameters (so project=... becomes available as %%project%%).
Update the UI lister (use Query Table + filter)
Open the todo UI in the Design app (.../app/design/common/ui?id=todo).
Update the LISTER tab:

Lister:
Query TableList Columns
Title:
Name, Path:data.nameTitle:
Project, Path:data.project
Main Filters
Path:
project, Widget:TextFilter, Properties:{ "label": "Project" }
Save the UI.
Next step
You now have a complete end-to-end example: CRUD + gateway + UI + query + saga.
If you want to expand it, add:
multiple filters (name contains, status, date range)
pagination/sorting in the query lister
authentication on the gateway channel
Troubleshooting
Empty results: ensure you have at least one todo with
data.project = "Personal".Saga returns an error about
queryId: confirm the Query ID is exactlytodo.Parameter not applied: confirm the saga reads from Input Element:
parametersand you call?project=....UI still does CRUD calls: confirm you added the Source URL for action
queryand changed the lister to Query Table.
Last updated





