# Data Collection — Agencies

## Table of Contents

* [Overview](#overview)
* [Getting Started](#getting-started)
* [Agency Types](#agency-types)
  * [What Agency Types Are](#what-agency-types-are)
  * [Managing Agency Types](#managing-agency-types)
* [Agencies](#agencies)
  * [What an Agency Record Contains](#what-an-agency-record-contains)
  * [Agency Status](#agency-status)
  * [Browsing and Filtering Agencies](#browsing-and-filtering-agencies)
  * [Creating an Agency](#creating-an-agency)
  * [Editing an Agency](#editing-an-agency)
  * [Deleting an Agency](#deleting-an-agency)
* [Agencies and Data Collection Workflows](#agencies-and-data-collection-workflows)
* [Common Scenarios](#common-scenarios)
* [Troubleshooting](#troubleshooting)

## Overview

Agencies are the educational organizations that participate in data collection in OtisEd.Nimble. Each agency represents a district, school, or other educational body that submits data files for processing. Before an agency can upload files or be assigned to a data collection workflow, it must have a record in the system with a unique code, a display name, and an optional classification through an agency type.

Agency types are a supporting reference list that groups agencies into categories — for example, distinguishing a local education agency from a state-level agency. Both agencies and agency types are managed by administrators with the appropriate permissions.

## Getting Started

To work with agencies and agency types, your account needs the relevant Data Collection permissions granted by your system administrator.

* **Viewing agencies and agency types**: requires the standard DcAgencies and DcAgencyTypes view permission.
* **Creating or editing agencies**: requires the DcAgencies Create or Edit permission respectively.
* **Deleting agencies**: requires the DcAgencies Delete permission.
* **Creating, editing, or deleting agency types**: requires the corresponding DcAgencyTypes Create, Edit, or Delete permission.

If you cannot see the agency management section or find that buttons such as Create or Edit are missing, contact your administrator to verify your permissions.

## Agency Types

### What Agency Types Are

An agency type is a simple classification label that can be applied to one or more agencies. It has a name and an optional description. Examples might include classifications such as "Local Education Agency," "State Agency," or "Charter School Network," depending on how your state or organization has defined them.

Agency types exist purely as reference data. They do not control workflow behavior on their own — they are used to organize and filter agencies. The name of an agency type can be up to 50 characters, and the description up to 255 characters.

### Managing Agency Types

Agency types are managed from the Agency Types administration section.

**To create an agency type:**

1. Navigate to the Agency Types administration page.
2. Select the option to create a new agency type.
3. Enter a name (required, maximum 50 characters).
4. Optionally enter a description (maximum 255 characters).
5. Save the record.

**To edit an agency type:**

1. Locate the agency type in the list using the search or filter tools.
2. Open the record and select the edit option.
3. Update the name or description as needed.
4. Save your changes.

**To delete an agency type:**

1. Locate the agency type in the list.
2. Select the delete option.
3. Confirm the deletion.

Before deleting an agency type, verify that no agencies are assigned to it. Removing a type that agencies currently reference may affect how those agencies are classified and displayed.

## Agencies

### What an Agency Record Contains

Each agency record holds the following information:

| Field             | Required | Notes                                                                                    |
| ----------------- | -------- | ---------------------------------------------------------------------------------------- |
| Code              | Yes      | Short identifier, maximum 10 characters. Used in file upload workflows and data routing. |
| Name              | Yes      | Display name, maximum 50 characters.                                                     |
| Description       | No       | Free-text description of the agency.                                                     |
| Agency Status     | Yes      | A numeric status value indicating the agency's current standing.                         |
| Agency Type       | No       | A classification linking the agency to an agency type record.                            |
| Organization Unit | No       | Links the agency to an internal organizational hierarchy.                                |
| Azure Folder      | No       | Storage folder path used for file upload routing.                                        |
| Azure Data Source | No       | Data source identifier for file processing pipelines.                                    |
| Azure SAS URL     | No       | Secure URL for Azure Blob Storage access, used by the file upload system.                |

The Code and Name fields are required when creating an agency. All other fields are optional.

### Agency Status

Each agency has a numeric status value that indicates its current state in the system. The status is used by data collection workflows to determine whether an agency is eligible to participate in file uploads and processing. Your administrator can confirm the meaning of specific status values for your deployment.

When filtering or searching the agency list, you can narrow results to a range of status values using the minimum and maximum status filter options.

### Browsing and Filtering Agencies

The agency list displays all agencies you have permission to view. The list supports filtering by:

* **Free text** — searches across code, name, and description fields simultaneously.
* **Code** — match a specific agency code.
* **Name** — match a specific agency name.
* **Description** — match text within the description.
* **Agency Status range** — show agencies whose status falls between a minimum and maximum value.
* **Agency Type** — filter by a specific type.
* **Organization Unit** — filter by an organizational hierarchy assignment.

The list is sorted by agency code by default. You can change the sort order by selecting a column header.

### Creating an Agency

1. Navigate to the Agencies administration page.
2. Select the option to create a new agency.
3. Enter a unique code (required, maximum 10 characters).
4. Enter the agency name (required, maximum 50 characters).
5. Set the agency status.
6. Optionally select an agency type from the dropdown list.
7. Optionally enter a description.
8. If the agency participates in file uploads, complete the Azure integration fields: Azure Folder, Azure Data Source, and Azure SAS URL. These values are provided by your system administrator or infrastructure team.
9. Optionally assign an organization unit.
10. Save the record.

The system validates that the code and name are not blank and that both are within their maximum lengths before saving.

### Editing an Agency

1. Locate the agency in the list.
2. Open the record and select the edit option.
3. Modify any fields as needed.
4. Save your changes.

All validation rules that apply on creation also apply when editing. The code and name remain required and must stay within their character limits.

### Deleting an Agency

1. Locate the agency in the list.
2. Select the delete option.
3. Confirm the deletion.

Deleting an agency removes its record from the system. Before deleting, confirm that the agency has no open data collection file requests and no associated data that depends on the agency record. Administrators should coordinate with other users before removing an agency that has active data collection activity.

## Agencies and Data Collection Workflows

Agencies are a foundational reference in the data collection system. Several other parts of the system depend on agency records:

* **File requests** are linked to an agency record. When a data file is submitted, the system uses the agency's code, Azure folder, and Azure data source settings to route the file to the correct storage location and processing pipeline.
* **File upload filters** allow users to narrow the list of pending file requests by agency, making it easy for staff from a specific district to find only their relevant submissions.
* **Navigation properties** — when the system fetches an agency with full navigation properties, it returns the related agency type record alongside the agency. This combined data is used in administration screens and reporting views to show the agency's classification in context.

The Azure integration fields (Azure Folder, Azure Data Source, Azure SAS URL) are only relevant for agencies that participate in file-based data collection. Agencies that do not upload files can be created without these fields.

## Common Scenarios

**Setting up a new district for data collection**

Create the agency record first, supplying the district's code, name, and status. Assign the appropriate agency type (for example, "Local Education Agency"). Provide the Azure folder path, data source identifier, and SAS URL supplied by your infrastructure team. Once the agency record is saved, the district can be assigned to data collection file request workflows.

**Classifying a large set of agencies by type**

If agency types do not yet exist for your classification scheme, create them first from the Agency Types page. Then edit each agency and assign the appropriate type. The agency type field is a dropdown populated from the existing agency types list.

**Finding all inactive agencies**

Use the agency status range filter on the agency list page. Set the minimum and maximum status values to the range that corresponds to inactive or archived status for your deployment. Contact your administrator if you are unsure which status values indicate inactive agencies.

**Updating Azure storage settings after infrastructure changes**

Open each affected agency record, update the Azure Folder, Azure Data Source, and Azure SAS URL fields with the new values, and save. File upload workflows will use the updated settings for all subsequent submissions.

## Troubleshooting

**An agency I expected to find does not appear in the list.**

Check whether any filters are active on the agency list. Clear all filter values and reload. If the agency still does not appear, you may not have permission to view it, or it may not exist. Contact your administrator.

**I cannot create or edit an agency.**

The Create and Edit buttons only appear if your account has the DcAgencies Create or Edit permission respectively. Ask your administrator to review your role permissions.

**The Agency Type dropdown is empty when creating an agency.**

No agency types have been created yet, or you do not have permission to view them. An administrator with DcAgencyTypes permission needs to create at least one agency type before it will appear in the dropdown.

**File uploads for an agency are failing with storage errors.**

This is often caused by incorrect or expired Azure integration settings on the agency record. Verify that the Azure Folder, Azure Data Source, and Azure SAS URL fields are correct and that the SAS URL has not expired. Coordinate with your infrastructure team to obtain updated values if needed.

**I accidentally deleted an agency type that was in use.**

Agency records that referenced the deleted type will have their agency type field cleared. You can recreate the agency type and then re-assign it to the affected agency records. Use the agency list with the agency type filter to identify agencies that no longer have a type assigned.


---

# 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://nimble.docs.otised.com/guides/data-collection-agencies.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.
