--- title: "School Actions" slug: "school-actions" description: "These are the Org actions that can be used in RapidIdentity Connect to manage schools for RapidIdentity Studio." tags: ["RapidIdentity ", "Connect", "Actions", "School", "Org", "Studio"] updated: 2022-06-03T18:59:06Z published: 2022-06-03T18:59:06Z canonical: "help.rapididentity.com/school-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. # School Actions ### getSchool Retrieves just one School. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the School | ```actionscript school = saveSchool({"name": "The School", "code": "234", "ncesId": 123451234512, "districtId": district.id}) school = getSchool(school.id) ``` ### getAllSchools Retrieves all Schools. | 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 schools = getAllSchools() SchoolId = " " if (schools.length <1) { school = saveSchool({"name": "School 1", "code": "321654", "ncesId": "123456789123", "districtId": districtId}) } else { schoolId = schools[0].id school = getSchool(schoolId) } ``` ### saveSchool Updates a School. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the School | ```actionscript schoolRec = createRecord() addRecordFieldValue(schoolRec, 'name', schoolName, false) addRecordFieldValue(schoolRec, "code", schoolCode, false) addRecordFieldValue(schoolRec, "ncesId, ncesId, false) addRecordFieldValue(schoolRec, "districtId", districtId, false) school = saveSchool(schoolRec) return school ``` ### getSchoolRelationship Retrieves just one School relationship. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the School relationship | ```actionscript school = saveSchool({{"name": "The School", "code": "234", "ncesId": 123451234512, "districtId": district.id}) schoolRel = saveSchoolRelationship ("schoolId": schoolId, "userId": user_id, "role": ADMINISTRATOR}) schoolRel = getSchoolRelationships(schoolRel.id) ``` ### getAllSchoolRelationships Retrieves all School Relationships. | Property | Value | Description | | --- | --- | --- | | schoolId | string | The school ID for which to fetch school relationships | | userId | string | The user ID for which to fetch school relationships | | role | string | The role for which to fetch school relationships | | pageSize | integer | The page size (required for a paging request) | | pageNum | integer | The page number (defaults to 1 for a paging request) | ```actionscript schoolRels = getSchoolRelationship(schoolId, user_id) schoolRelId = " " if (schoolRels.length <1) { schoolRel = saveSchoolRelationship ("schoolId": schoolId, "userId": user_id, "role": ADMINISTRATOR}) schoolRelID = schoolRel.id } else { schoolRelID = schoolRels[0].id schoolRel = getSchoolRelationships(schoolRelId) } ``` ### saveSchoolRelationship Updates a School relationship. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the School relationship | ```actionscript id = "cc913124-c1d6-4716-9462-42e5577c730f" schoolId = "aef284b-9c6fe-4ad1-8e12-8cd7ee0b7c4f" conn = openMetadirLDAPConnection() schoolRel = saveSchoolRelationship({"userId": id, "schoolId": schoolID, "role": "ADMINISTRATOR"}) log('Adding User with Email: "' + email + '" as an Administrator for School with ID: "' + schoolID + '"') close(conn) return id ``` ### deleteSchoolRelationship Deletes a School Relationship. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the School Relationship | Delete by School Relationship id. ### deleteSchool Deletes a School. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the School | Delete by School id. ### deleteSchoolType Deletes a School Type. | Property | Value | Description | | --- | --- | --- | | id* | string | The ID of the School Type | Delete by School Type id.