Outcomes allows you to create Custom Properties that capture the applicant information of your choice. Using the Calculated Property option, you can insert JavaScript code that makes a determination and returns a value based on the conditions you configure. In this article, you'll learn how to add a calculated property that returns a different value based on when the applicant submitted their application.
For example, if your applicants are grouped or reviewed differently based on whether they submitted their application before or after a specific date (e.g., a different start term), you can use this advanced configuration to add a field that indicates which group they are in.
This field could then be included in exports, filters, the Application Summary, or the Applications Grid.
To complete this configuration, you'll first need to create a custom property that looks for the submission date and returns the value of your choice. To do this:
When creating a calculated custom property as described above, you're presented with an Expression window. Paste the following code into that window. Use the view source icon to copy the code snippet.
{ let dateField = cas_date_submitted; let startDate1 = new Date("2024-06-15T00:00:00"); let startDate2 = new Date("2023-10-16T00:00:00"); let returnOption1 = "Text Option 1"; let returnOption2 = "Text Option 2"; /*This field calculates which text should based on their cas_date_submitted value*/ if (typeof dateField == "undefined") { return null; } let date = new Date(dateField); if (date >= startDate1 && date <= startDate2) { return returnOption1; } else if (date > startDate1) { return returnOption2; } else { return null; } }
For this code to work in your environment, you'll need to update the variables with data that is relevant in your Outcomes instance.
The following variables are present in the JavaScript expression listed above. To effectively implement this configuration, replace the variables as follows:
let returnOption1 = "September 1"
let returnOption2 = "January 5"
As coded, the custom property will remain blank if the submitted date is before the value you entered as startDate1.
Once you've configured your custom property, by default, it becomes visible for each application on the Application Properties page.
If desired, can also use the property in other areas, such as: