> For the complete documentation index, see [llms.txt](https://docs.shiftiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shiftiq.com/contributors/implementation/front-end/shift.ui/ui-search.md).

# Search

I’ll be using Gradebook Search screen as an example

1. Create an interface for the API Row model (ApiGradebookMatch) and API Query model (ApiSearchGradebooks)\\

   <figure><img src="/files/WQw2dQBrVMjtfjZsYVie" alt="Search api models"><figcaption></figcaption></figure>
2. Add search and download methods to the controller object:

   <figure><img src="/files/KeuGosbj00GWCTIH0QAL" alt="Search api functions"><figcaption></figcaption></figure>
3. Go to cacheKey.ts and add a new unique key to the union type CacheKey
4. Create a new folder /src/routes/admin/records/gradebooks/search\
   This folder will contain code related to Gradebook Search form
5. Create a new file GradebookRow\.ts with interface GradebookRow and the function toGradebookRow\\
   * GradebookRow provides properties used by Result Grid.
   * toGradebookRow converts ApiGradebookMatch to GradebookRow
6. Create a new file GradebookCriteria.ts with the interface GradebookCriteria and functions defaultGradebookCriteria and toApiSearchGradebooks
7. Create a new file Gradebook\_Search.tsx and specify all criteria input field here
8. Create a new file GradebookSearch\_Result.tsx and specify all Result Grid fields here
9. Create a new file GradebookSearch\_Download.tsx and specify all download fields here
10. Create a new file GradebookSearch.tsx that joins Search, Result, and Download components.
11. Add a new Search form to routes in the file /src/routes/formRoutes.tsx:

    <figure><img src="/files/ZNWoYjUF1kjykw4g10R6" alt="Search menu"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.shiftiq.com/contributors/implementation/front-end/shift.ui/ui-search.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
