# 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=""><figcaption></figcaption></figure>
2. Add search and download methods to the controller object:

   <figure><img src="/files/KeuGosbj00GWCTIH0QAL" alt=""><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=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
