Skip to main content
Liaison

Migrating Outcomes Data to Custom Fields in WebAdMIT

Overview

If you'd like to transfer data from Liaison Outcomes to WebAdMIT, you can do so using the Outcomes to WebAdMIT data migration process. This process uses a Python script to move data from Outcomes to custom fields in WebAdMIT.

This works by following these steps:

  1. Outcomes exports a CSV file to an SFTP location.
  2. The Python script picks up the CSV file and uses the WebAdMIT API to load the data into custom fields in WebAdMIT.
  3. The script archives the file for data retention and auditing purposes.

Prerequisites

To set up this migration process, you'll need to have the following in place:

  • A Windows server to host the Python script.  Since Outcomes exports data to an SFTP location, this Windows server can be collocated with the SFTP server. To set up the server, you'll need to:
    1. Establish an account with admin rights on the server.
    2. Install Notepad++ on the server to edit the Python script.
    3. Install Python on the server that hosts the script.
    4. Optional: If the SFTP server and the Python script are on two different servers, you'll need a script or batch file to move the data from the SFTP to the script server.
  • The fields needed for the export in Outcomes should be configured in prelaunch and production.
  • WebAdMIT's custom fields should also be built in prelaunch and production.

Creating custom fields in WebAdMIT

Identify the fields you want to migrate from Outcomes to WebAdMIT. Then, create custom fields in WebAdMIT that will be the destination for this data.

WebAdMIT User Identities

To access the WebAdMIT API, you need an Institution Manager in WebAdMIT that can access data for all departments and programs at the university. You should have an Institution Manager account in the prelaunch and production environments. Once that is in place, complete the following steps in both environments:

  1. Log in to WebAdMIT with the Institution Manager account.
  2. Click Account on the top right to view Account Details.
  3. Click Edit My Account on the top right.
  4. Verify that your account has the correct organization assignments and program assignments.
  5. In the API Key section, click Generate New Key to generate a unique API key for your account.
  6. Click Show Key to view your API Key.
  7. Make note of the API Key, which will be required for the script and retrieving your identity ID.

Retrieving Your User Identity ID

  1. Make the following API call to retrieve your User Identity ID.
  2. Use CURL or POSTMAN to make the below API calls:
  • PRODUCTION
$ curl -n https://api.webadmit.org/api/v1/user_identities \
  -H "x-api-key: <ENTER YOUR API KEY>"
  • PRELAUNCH
$ curl -n https://prelaunch.webadmit.org/api/v1/user_identities \
-H "x-api-key: <ENTER YOUR API KEY>"
  1. Make sure to use the correct API Keys for PRELAUNCH and PRODUCTION.
  2. A successful API call should generate a status code of “200” with the following example response body:           
{
"href": "/api/v1/user_identities",
"user_identities": [
{
"id": 42,
"type": "Admissions User",
"association": "SOPHAS",
"institution": "Demo University",
"organization": "Demo University School of Public Health",
"cycle": "2014 - 2015"
}
]
}
  1. Make note of the number after "id":. Corresponding to the cycle for which you want your applicant custom fields updated, this is the identity ID and is needed for prelaunch and production. This “id” is needed to retrieve the order of the custom fields in the next section.
  2. If the API call is unsuccessful, then it will return a status code of 401. This means the user is not authorized to gain access to the API. Verify the user’s permissions in WebAdMIT and ensure the user has the correct organization and program assignments.

Retrieving the Order of custom fields in WebAdMIT

  1. Make the following API calls to retrieve the order of the custom fields in WebAdMIT.  The examples below are for production WebAdMIT. To use the below code for prelaunch, please use the following base URL: https://prelaunch.webadmit.org
  2. Retrieve the Program ID associated with the User Identity ID by making the following call:
$ curl -n https://api.webadmit.org/api/v1/user_identities/:<ENTER USER_IDENTITY_ID>/programs/
 -H "x-api-key: <ENTER YOUR API KEY>" 
  1. Then, make the following API call to retrieve the Custom Field list:
$ curl -n https://api.webadmit.org/api/v1/user_identities/:<ENTER USER_IDENTITY_ID>/programs/:<ENTER PROGRAM_ID>/custom_fields \
-H "x-api-key: <ENTER YOUR API KEY>"  
  1. A successful API call should generate a status code of “200” with the following example response body:           
{
"href": "/api/v1/user_identities/1/programs/42023191739237/custom_fields",
  "custom_fields": [
    {
      "id": 4,
      "label": "Preferred house",
      "field_type": "select",
      "options": [
        "Gryffindor",
        "Hufflepuff",
        "Ravenclaw",
        "Slytherin"
      ]
    }
  ]
}
  1. Note all the labels as they are listed one after the other. You will need the list of labels in this exact order to build the export in Outcomes.

Configuring the Outcomes Export

To move any data points from Outcomes to WebAdMIT via SFTP, you must configure an export in Outcomes. Before setting up the export in Outcomes, it is important to have the list of labels for the custom fields in WebAdMIT in the configured order, as shown previously. Then:

  1. Create an export in CSV format as outlined in the article Working with Application Exports. The script to move data from Outcomes to WebAdMIT expects a CSV file as an input.
  2. Create the name of the CSV file without a date parameter, as that is something the script will handle as part of the archiving process.
  3. The CSV file should contain column headers.
  4. WebAdMIT custom fields are data type sensitive, so it is important to ensure:
    • Numeric fields in Outcomes are mapped to numeric custom fields in WebAdMIT.
    • Boolean fields in Outcomes are mapped to Boolean fields in WebAdMIT.
    • Multi-select fields in Ouctomes can be mapped to string fields or a select list custom field in WebAdMIT. If using select field in WebAdMIT, ensure the drop-down values match all possibilities that are derived from Outcomes.
    • String fields in Outcomes are mapped to string custom fields in WebAdMIT.
  5. The script  expects the export fields to be in this order:
    • CASID
    • Program Unique Identifier String
    • Data fields (in the same order as WebAdMIT API returns for custom fields created in WebAdMIT).
  6. Reference the article Working with Export Destinations to configure the export to send the data to an SFTP server.

Python Installation

You'll need to install Python on the server that will be hosting the script. To do so:

  1. Download the software from https://www.python.org/downloads/.
  2. Download the latest release for Windows (based on whether the server is a32 bit or 64 bit).
  3. Once downloaded, run the Python install file as an administrator.
  4. This opens an installation window:

Integration Python installation

  1. Click Customize Installation to display  Optional Features:

Integration Python Install Optional Features

  1. Ensure that pip is selected.
  2. The next page displays advanced installation options:

Integration Python install Advanced Options

  1.  Select the path to install Python and click Install.
  2. Once Python is successfully installed, restart the server.
  3. Once restarted, navigate to your system environment variables to ensure Python is appended to the end of the PATH variable. If it is not, you will need to add it. The path should be the path to the Python executable, such as C:\Users\username\AppData\Local\Programs\Python\Python310
  4. To test that your Python installation was successful and added successfully to your PATH variables, run Command Prompt as an administrator, type python, and hit enter:

Integration Python installation command prompt

  1. If the response is similar to “Python is not recognized as an internal or external command”, then it could mean that the PATH variable is not correctly set up or your Python was not correctly installed.

Editing the Python script

  1. Download the Python script and config.json file from Integration Help Center and place it on the windows server meant to host the script.
  2. On the server, create a folder called OutcomesToWebAdMIT.
  3.  Create a sub-folder called Archive.
  4. Place the Python script and the config.json file in the OutcomesToWebAdMIT folder.
  5. The CSV file from Outcomes must also be dropped in the OutcomesToWebAdMIT folder when ready.
  6. Edit the config.json file in the OutcomesToWebAdMIT folder using Notepad++ or Notepad and make the following changes:
    • Change the Api_key value to your API key for prelaunch or production.
    • Change the url_link value to prelaunch or production url.
    • Change Working_dir to the full directory path of your OutcomesToWebAdMIT folder. Note that the directory separations use  "/".
    • Set File_name to the name of the incoming CSV file from Outcomes.
    • Set Cycle in the following format “2023 - 2024” depending on the cycle you are working with. Note that this value changes each cycle so will need to be updated regularly.

Creating a Python executable

Next, you'll need to create a Python executable that will run the script. To do so:

  1. Open Command Prompt as an administrator.
  2. Run the following command: pip install pyinstaller
    • If you get an error message that  pip is not recognized as an internal or external command, this means your Python installation did not include the pip package.
    • The article How to Install PIP on Windows provides guidance on installing pip.
    • Once installed, type pip –version in Command Prompt to verify if the installation was successful.
    • If pip installation was successful, rerun thepip install pyinstaller command.
  3. Run the following command: pip install requests and ensure the requests module gets installed correctly.
  4. If pyinstaller and requests installation was successful, in Command Prompt, navigate to the OutcomesToWebAdMIT directory.
  5. Type the following command: pyinstaller --onefile main.py and press enter.
  6. This command converts the script into an executable.
  7. The executable is found in the \OutcomesToWebAdMIT\dist\ folder.
  8. Copy the config.json file from the OutcomesToWebAdMIT folder to \OutcomesToWebAdMIT\dist\ folder.

Testing the executable

The following should be completed for prelaunch Outcomes to prelaunch WebAdMIT:

  1. Navigate to the \OutcomesToWebAdMIT\dist\ folder in Windows Explorer and double-click main.exe to open a running Command Prompt window.
  2. If the Command Prompt window closes immediately after opening, then there is an issue with your Python code or the config.json file. In that case, navigate to the OutcomesToWebAdMIT \dist folder and check the main.log file. If this file shows HTTP connection errors, this could mean that your API key, URL, or Cycle is incorrect.
  3. Edit the config.json file to make sure the file name, directory paths, API keys, base URL, and cycle are correct.
  4. Once verified, run the executable again.
  5. If the executable continues to run, this means the JSON file is correct.
  6. Drop a CSV export from Outcomes to the OutcomesToWebAdMIT folder. The file will be picked, processed, and archived by the executable.
  7. Navigate to the Archive folder under OutcomesToWebAdMIT\Archive folder. You will see a timestamped_yourfilename.csv file.
  8. Open the file, and you will see HTTP status codes printed in each row.
  9. The number of status codes printed would be equivalent to the number of fields that need to be processed. So, if five fields need to have data loaded to five custom fields in WebAdMIT, then the status codes will be printed five times per row.
  10. Successful loads would have a status code of 200, while unsuccessful loads would have a status code of 404.
  11. The 404 status code could indicate several issues, including custom fields missing in WebAdMIT, incorrect authentication methods (api_key), or CASID not found in WebAdMIT.
  12. If all rows show a 200 for each field, then the next step is to check prelaunch WebAdMIT to ensure the data was loaded correctly into corresponding custom fields.
  13. If the data is not loaded into the correct custom fields, but is present, this means that the order of the fields in your Outcomes export is incorrect.
  14. If all looks good, then close the running executable command prompt window and delete the archived file.

Setting the Python Executable as a Windows Service

To keep the script running indefinitely, the following steps are required to set up the Python executable as a windows service. For this purpose, you'll need to install a tool called NSSM (Non-Sucking Service Manager).

  1. On your web browser on the Windows server meant to host the script, navigate to https://nssm.cc/download
  2. Download the latest release of NSSM which is nssm 2.24.
  3. This should download a zip file called nssm-2.24.zip.
  4. Extract the zip file in the OutcomesToWebAdMIT folder.
  5. Open Command Prompt as an administrator, and within Command Prompt,  navigate to OutcomesToWebAdMIT\nssm-2.24\win64 (or win32, depending on your windows server).
  6. Run the following command by replacing the paths to your python executable and python (.py) file:
    • nssm install "OutcomesToWebAdMIT" "PathTo\OutcomesToWebAdMIT\dist\main.exe" "PathTo\OutcomesToWebAdMIT\main.py"
  7. If the service is successfully installed, it displays the following message in command prompt Service "OutcomesToWebAdMIT" installed successfully!.
  8. Open services.msc in Windows as an admin and locate the OutcomesToWebAdMIT service.
  9. Start the OutcomesToWebAdMIT service.

Testing the OutcomesToWebAdMIT Service

  1. To test the service, navigate to Testing the executable and perform steps 6 to 14.
  2. If the test is successful, then stop the OutcomesToWebAdMIT service in services.msc and make sure to delete the archived file.
  3. After all testing is completed and preparations are being made to move to production then perform the following steps to remove the service:
    • Open Command Prompt as an administrator, and within Command Prompt navigate to OutcomesToWebAdMIT\nssm-2.24\win64 (or win32 depending on your Windows server).
    • Run the following in Command Prompt:nssm remove “OutcomesToWebAdMIT”
    • A dialog box will open to ask if you want to remove the service, click yes, and it should say the service was successfully removed.
    • Open services.msc as an admin and refresh the services to ensure the OutcomesToWebAdMIT service is not in the list of services.

Moving the Script to Production

  1. If all testing has been completed in the prelaunch environments, then it is time to prepare the script for production use.
  2. Navigate to the OutcomesToWebAdMIT folder in Windows Explorer.
  3. Delete the following file and folders:
    • Build folder.
    • Dist folder.
    • Main.spec file.
  4. Edit the config.json file found in the OutcomesToWebAdMIT folder.
  5. In the file, change the  API key, URL, and cycle to production values.
  6. Save the file.
  7. Perform the steps found in Creating a Python executable section.
  8. Perform the steps found in Setting the Python executable as a Windows Service section.
  9. Start the OutcomesToWebAdMIT service.
  10. Have Outcomes production drop a CSV file to the OutcomesToWebAdMIT folder.
  11. Check the archived file for status codes for a successful load.

Cycle Over Cycle Changes

  1. Cycle over cycle, review your custom fields in WebAdMIT and make note of any new custom fields that need to be added.
  2. If new custom fields are added, make sure you follow the steps in Retrieving the Order Custom Fields in WebAdMIT and configure your Outcomes export to match accordingly.
  3. If a new export is created in Outcomes each cycle, then make sure the new export is configured to deliver files to SFTP and is named the same as the previous one. If the file name needs to change, make note of the new filename.
  4. Stop the OutcomesToWebAdMIT service.
  5. Edit the config.json file in your OutcomesToWebAdMIT and \OutcomesToWebAdMIT\dist folders.
  6. Update the filename if you plan to use a new filename for the new cycle in the config.json file.
  7. Update the cycle to correspond with the new cycle in the config.json file.
  8. If you plan to use a completely new WebAdMIT user for the new cycle, change the API Key and cycle in the config.json file.
  9. Save the config.json file in the OutcomesToWebAdMIT and \OutcomesToWebAdMIT\dist folders with the changes.
  10. Start the OutcomesToWebAdMIT service.

Special Considerations

  1. If you have multiple CASs that require custom fields updated in WebAdMIT, then you will need one version of the script and config.json file per CAS.
  2. If you have overlapping cycles for your CAS, then you will need two versions of this process per CAS cycles that are overlapping. Make sure to stop and delete the service for the previous cycle once it ends.
  • Was this article helpful?