OK, but let me tell you something…
You already have on serverside the saved options, right?
sc_qry_selectedAcadYear.data.query_selAcadYear…
So, you don’t have to keep them in an array and send them over to serverside.
- first in your serveraction create that query to get the used academic years (like in sc_qry_selectedAcadYear.data.query_selAcadYear)
- after that, add a setValue (in order to pull the usedAcademicYears in an Array) like that:
this returns the ids of the already used academic years in an Array - then in your existing query that returns the select options
sc_qry_masterAcadYear.data.query_masterAcadYear, you can filter it with the output of the previous step’s Array (usedAcadYearsID_Array):
acadYearID NOT IN usedAcadYearsID_Array
(I don’t know if I write your fields and names correct , please check it)