Current Term Indicator in Advanced List?

Is it possible to get a current term field similar to the current School year field?

Comments

  • Funny enough, I was just on this site earlier today looking around to see if anyone had a solution for this. I couldn't find anything so I wrote this:

    var termData = bbGet("https://api.sky.blackbaud.com/school/v1/terms?offering_type=1")

    var currentTerm;

    var divLevel = {divisionLevelID}

    const day = new Date();

    const today = day.toJSON();


    for(i = 0; i < termData.value.length; i++){

    if(termData.value[i].level_id === divLevel && termData.value[i].begin_date <= today && !(termData.value[i].end_date < today)){

    currentTerm = termData.value[i].id.toFixed(0);

    break;

    }

    }

    bbGet is a reference to some code that I wrote elsewhere that makes the API call. Basically termData is just all the data that came from skyAPI at the endpoint listed. You may need to use a different offering type, but “offering_type=1” worked for me.

    Also the Level ID will need to be defined for your school so it knows which division to filter to.

    This will return the ID number for the current term, but you should be able to switch it to the name easily enough.

    Oh and, I just realized, you may not be working in JavaScript, but this is JavaScript.

    Hope that helps!

  • Thank you very much! I was using R for this particular problem but I was able to translate from js no problem. Have a good one ?

Categories