Skip to main content
Liaison

Creating Filters for Data in Tables

It may be useful for you to filter applications using data points not exposed in Outcomes's standard filters. For example, data stored in an array or table (e.g., Colleges Attended, Accreditation Status,  etc.) is not available to query for in application filters. This is also true of any data point stored in a Named Row table you've created on a form.

named-row-table-applicant-form.png

To work around this, you'll need to create Custom Properties for each of these data points, and then display the Custom Properties as desired.

Creating the Custom Properties

To filter your applicants using fields from a table, you'll first need to add Custom Properties to capture this information. Once you're finished, you'll have fields on each application that display your desired information. To add the Custom Properties:

  1. Navigate to the Settings menu and click Application Properties under the Application Setup heading.

    Custom Properties in the Settings menu
  2. Click the Edit Pencil.
  3. Click and drag the Calculated Property option from the left to the list on the right.

    Dragging a calculated property
  4. After placing the field as desired, configure its name (e.g., High School GPA).

    Custom Property using a named row javascript expression
  5. Select the appropriate Data Type.
  6. Next, enter the JavaScript Expression that looks for the appropriate field, as shown below.
  7. Once you've completed this, click Add.
  8. Repeat steps 3-7 for any additional fields you'd like to create.

Applying the Required JavaScript Expressions

In Outcomes, JavaScript expressions allow you to dynamically incorporate other data points from the software in a Custom Property. In this case, you'll need to add the following JavaScript Expressions for each data point you'd like to use in filters. For each field you're adding, you'll need to:

  1. Copy the JavaScript expression below.
  2. Edit the JavaScript to insert the appropriate field keys.
  3. Paste the code into the Expression window when completing Step 6 above. (Use the view source icon at the top right to copy the code snippet.)
JavaScript Code to Use
{
    // Enter the ID of form data to return
    let formId = 'forms.your_form_name'
    // Enter the ID of table data to return
    let tableId = 'yourTableName';
    // Enter the ID of column data to return
    let columnId = 'yourColumnId';
    // Enter the ID of named row data to return
    let statusKey='yourRow';


    // DO NOT EDIT BELOW
    if ((forms[formId])
        && (forms[formId][tableId].rows)) {

        let rowRef = forms[formId][tableId].rows;
       return (rowRef[statusKey][columnId]) ? (rowRef[statusKey][columnId]) : null;
    
    } else {
      return null;
    }  
  }
Modifying the Code

For this expression to work in your environment, you'll need to replace the four variables at the top of the code snippet.

  1. On the line let formId = 'forms.your_form_name', replace forms.your_form_name with the key of the form that contains the data you need. To use the form in the example below, you'd replace forms.your_form_name with HighSchool.

    Sample applicant form using named rows
  2. On the let tableId = 'yourTableName' line, replace yourTableName with the key from the table you want to use. In the example above, highSchoolGPA is the key you would use.
  3. On the let columnId = 'yourColumnId' line, replace yourColumnId with the key from the column you want to use. For example, if you wanted to extract the GPA from the table shown above, you could click the GPA column to see its details. As seen below, the key is gpa.

    Sample table column info
  4. Lastly, on the let statusKey='yourRow' line, replace yourRow with the key for the row you're using. In the example above, if you wanted to work with the Junior Year GPA, you could click the Junior Year named row to see its key. In this case, the key is juniorYear.

    Finding the key on an named row

 With the updates from this example, the editable area of the code would appear as follows:

{
    // Enter the ID of form data to return
    let formId = 'HighSchool'
    // Enter the ID of table data to return
    let tableId = 'highSchoolGPA';
    // Enter the ID of column data to return
    let columnId = 'gpa';
    // Enter the ID of named row data to return
    let statusKey='juniorYear';

Once this is complete and the code is used in a Custom Property, each application will have a Junior GPA custom property usable in queries and exports.

Working with the new Custom Properties

After completing the steps above, the data you've pulled in now appears as a Custom Property on each application. This allows you to run filters based on that data.

To find the accreditation status for an individual applicant:

  1. Navigate to their application.
  2. Click the More Options (three dots) button and select Application Properties.

    The More Options button on an application
  3. The new fields you've built appear here.

    accreditation-status-aapi.png

To filter using these fields:

  1. Navigate to the Applications View.
  2. Click the Filter icon and select Add Filter.

    Filtering applications
  3. Click Application Property and find the field you'd like to filter on.

    Accreditation status filter
  4. Next, adjust the filter as necessary.

    Applying the accreditation status filter
  5. Click APPLY to add your filter. The applications that appear are those that match your query.

 

  • Was this article helpful?