Skip to main content
Liaison

Exporting Recommender Details

If you're exporting applicant information from Outcomes into a file, you may wish to include information about the applicants' references, or recommenders. This advanced configuration allows you to extract recommender details (e.g., their name, email address, or organization) to an export file.

Determine Which Information You Need

Before configuring the JavaScript for your export, you'll need to determine which data points you want to export. This may include:

  • Recommender name
  • Recommender email address
  • Recommendation complete?
  • Recommendation date requested
  • Recommendation date complete

The code to use for this configuration will vary based on which details you want to include.

Add the Java Script Code

You have two options when adding the JavaScript Code for this expression:

  • Create a Custom Property using this code. Once created, Custom Properties are listed among the Available Fields in the Export Builder.
  • Add the JavaScript expression directly from the Export Builder by selecting the Custom option from the Available Fields menu, and dropping it into the Columns window.

In either case, you'll have an Expression area to add your code and configure it as desired. To complete this process:

  1. In the Expression area, add the following code. (Use the view source icon at the top right to copy the code snippet.)
{
    /* * * * * * * * * * * * *
     * * USER INPUT SECTION * *
    * * * * * * * * * * * * */

    // use this field to determine the number recommendation you want to output.
    let recNumber = 1;

    // use this field to define the information you want returned
    //choose one of the field names below and enter it into "field" exactly as written
    // name, email, is_complete, dateRequested, dateCompleted

    let field = "name";

    /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
       This function takes two inputs to return a single recommendation field.
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

    recNumber = recNumber - 1;
    let type = "";

    // checks where in JSON the requested data is stored

    if (field == "email" || field == "name" || field == "is_complete") {
        type = "outer";
    } else if (field == "dateRequested" || field == "dateCompleted") {
        type = "date";
    } else if (field == "recommender_organization" || field == "recommender_title") {
        type = "inner";
    } else {
        return;
    }

    if ((references) &&
        (references.recommendations) &&
        (references.recommendations.references) &&
        (references.recommendations.references.length > 0) &&
        (references.recommendations.references[recNumber])) {

        if ((type == "outer") && (references.recommendations.references[recNumber][field])) {
            return references.recommendations.references[recNumber][field];
        } else if ((type == "date") && (references.recommendations.references[recNumber][field])) {

            let ref = references.recommendations.references[recNumber][field];
            return ref.slice(5, 7) + "/" + ref.slice(8, 10) + "/" + ref.slice(0, 4);

        } else if ((type == "inner") && (references.recommendations.references[recNumber].forms) &&

            (references.recommendations.references[recNumber].forms.overall_recommendation) &&
            (references.recommendations.references[recNumber].forms.overall_recommendation[field])) {

            return (references.recommendations.references[recNumber].forms.overall_recommendation[field]);

        } else {
            return;
        }
    } else {
        return;
    }
}
  1. Decide which recommendation you'd like to export, and set the value for recNumber accordingly. For example, if you want to export the information from the second recommendation, change let recNumber = 1 to let recNumber = 2.
  2. Decide which data point you'd like to export, and set the value for field accordingly:
    • For the recommender's name, enter  let field = "name";
    • For the recommender's email address, enter let field = "email";
    • For the recommendation's requested date, enter let field = "dateRequested";
    • For the recommendation's completed date, enter let field = "dateCompleted";
    • For the recommendation's completion status, enter let field = "is_complete";
  3. Repeat the steps above for each data point and each recommendation you'd like to include in your export.
  • Was this article helpful?