Change the Grade Level to Numbers
- 31 Jul 2023
- 1 Minute to read
- Print
- DarkLight
Change the Grade Level to Numbers
- Updated on 31 Jul 2023
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
How to Change the Grade Level to a Number
The OneRoster data type standard for the grades
field on the user record is string
with specific values expected based on the grade.
The following example was used to convert a grade level of KG
to 0 and PR
to -1 allowing all other grade level values to remain the same.
function() {
const grades = SRC.grade;
if (grades) {
const grade = grades[0];
if (grade == 'KG') {
return '0';
}
else if (grade =='PR') {
return '-1';
}
else {
return grades;
}
}
return null;
}
Was this article helpful?