--- title: "District Actions" slug: "district-actions" description: "This is a list of actions that can be used by RapidIdentity Connect to interact with District data for RapidIdentity Studio." tags: ["RapidIdentity ", "Connect", "Actions", "District", "Org"] updated: 2022-06-03T19:16:58Z published: 2022-06-03T19:16:58Z canonical: "help.rapididentity.com/district-actions" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.rapididentity.com/llms.txt > Use this file to discover all available pages before exploring further. # District Actions ### getDistrict Retrieves just one District. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the District | ```actionscript district = saveDistrict({"name": "District 1", "code": "123456", "ncesID": "123456", "stated": stateId}) district = getDistrict(district.id } ``` ### getAllDistricts Retrieves all Districts. | Property | Value | Description | | --- | --- | --- | | pageSize | integer | The page size (required for a paging request) | | pageNum | integer | The page number (defaults to 1 for a paging request) | ```actionscript districts = getAllDistricts() districtId = " " if (districts.length <1) { district = saveDistrict({"name": "District 1", "code": "123456", "ncesID": "123456", "stated": stateId}) districtID = districtid } else { districtId = districts[0].id district = getDistrict(districtId) } ``` ### saveDistrict Updates a District. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the District | ```actionscript districtRec = createRecord() addRecordFieldValue(districtRec, 'name', districtName, false) addRecordFieldValue(districtRec, "code", districtCode, false) addRecordFieldValue(districtRec, "ncesId", ncesId, false) addRecordFieldValue(districtRec, "stateId", stateId, false) district = saveDistrict(districtRec) return district ``` ### getDistrictRelationship Retrieves just one District Relationship. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the District Relationship | ```actionscript district = saveDistrict({"name": "District 1", "code": "123456", "ncesID": "123456", "stated": stateId}) districtRel = saveDistrictRelationship({"districtId": districtId, "userId": user_id, "role": "ADMINISTRATOR"}) districtRel = getDistrictRelationship(districtRelId) ``` ### getAllDistrictRelationships Retrieves all District Relationships. | Property | Value | Description | | --- | --- | --- | | districtId | string | The dID for which to fetch district relationships | | userId | string | The user ID for which to fetch district relationships | | role | string | The role for which to fetch district relationships | | pageSize | integer | The page size (required for a paging request) | | pageNum | integer | The page number (defaults to 1 for a paging request) | ```actionscript districtRels = getDistrictRelationships(districtId, user_id) districtRelId = " " if (districtRels.length < 1) { districtRel = saveDistrictRelationship({"districtId": districtId, "userId": user_id, "role": "ADMINISTRATOR"}) districtRelId = districtRel.id } else { districtRelId = districtRels[0].id districtRel = getDistrictRelationship(districtRelId) ``` ### saveDistrictRelationship Updates a District Relationship. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the District Relationship | ```actionscript district = saveDistrict({"name": "District 1", "code": "123456", "ncesID": "123456", "stated": stateId}) districtRel = saveDistrictRelationship({"districtId": districtId, "userId": user_id, "role": "ADMINISTRATOR"}) ``` ### deleteDistrictRelationship Deletes a District Relationship. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the District Relationship | Delete by District Relationship id. ### deleteDistrict Deletes a District. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the District | Delete by District id.