Hi all,
I'm trying to write a scripted field.
But I"m unable to execute else if condition as below:
if (doc.containsKey("report_card.grade") && !doc["report_card.grade"].empty) {
if (doc["report_card.grade"].value == 5) { return "A"; }
else if
(doc["report_card.grade"].value == 4) { return "B"; }
else if
(doc["report_card.grade"].value == 3) { return "C"; }
else if
(doc["report_card.grade"].value == 2) { return "D"; }
else if
(doc["report_card.grade"].value == 1) { return "E"; }
else if
(doc["report_card.grade"].value == 0) { return "F"; }
else { return "-" ; } }
else { return "-" ; }
I have tried condition with >= or <=, still it displays only 1 value(A or E)
I'm trying to figure out where i went wrong in code.
But unable to do so.
Any help please.