List Validated Fields

What are List Validated Fields?

List Validated Fields are data fields that require an exact value match to one of the values from the list corresponding to the data field. An example of a list validated field is "gender". When an administrator is inputting an employee's demographic info and arrives to the "gender" portion, there is a list of valid values to choose from. Any of the values from this list are valid, so the administrator cannot enter a value not in the list. If the administrator enters an invalid value, they will see this failed response:

{
    "status": "failure",
    "errors": [
        {
            "http_status": 400,
            "message": "Invalid value for gender.  The valid values are M,F.",
            "details": null,
            "error_code": 400
        }
    ],
    "data": []
}

There are a couple ways to correct this error. The administrator could choose from the valid values listed in the response, or the administrator can create another valid value for this list validated field.

Managing Values in Employee Groups

Within PlanSource, there are two places to manage list validated fields. The first location is called Employee Groups, and it is used to determine employee benefit eligibility.

942

To navigate to the Employee Groups section, login to your client within PlanSource's Benefit Admin site.

  1. Select the Configure tab from the top row.
  2. Select the Employee Groups tab from the left column.

The five fields that can be managed are:

  • Class
  • Division
  • Location
  • Union
  • Employment Level

To manage the valid values in these fields, enter the values in the appropriate text boxes separated by comma per value. Check the box next to each list that is used to determine employee benefit eligibility. Once the configuration is saved, make a call to the endpoint GET /subscriber/meta to check if the values entered match the values from the call's response. Below is an excerpt from the GET /subscriber/meta response after managing the list validated fields within Employee Groups:

"org_class": {
                "update": true,
                "required": false,
                "caption": "Class",
                "data_type": "STRING",
                "validation_data": [
                    [
                        "HOURLY",
                        "HOURLY"
                    ],
                    [
                        "SALARY",
                        "SALARY"
                    ]
                ]
            },
"location": {
                "update": true,
                "required": false,
                "caption": "Location",
                "data_type": "STRING",
                "validation_data": [
                    [
                        "FLORIDA",
                        "FLORIDA"
                    ],
                    [
                        "UTAH",
                        "UTAH"
                    ]
                ]
            }

📘

Meta Endpoints

More information on Meta Endpoints can be found here!

Managing Values in Data Field Captions

The second location to manage list validated fields is called Data Field Captions.

942

To navigate to the Data Field Captions section, login to your client within PlanSource's Benefit Admin site.

  1. Select the Configure tab from the top row.
  2. Select the Data Field Captions tab from the left column.
942

In order to add valid values to a data field, first find a data field allowed to be made into a list validated field (the pencil icon next to the data field should not have a red mark through it).

  1. Click on the Pencil Icon next to the appropriate data field.
  2. Click on the drop down menu labeled Validation type.
  3. Select List from the menu.
  4. Enter values separated by commas into the Validation List Items text box.
  5. Click Add Value to add the values to the list.
  6. Click Save to save the new values.

📘

The same process above can be used to update an existing list validated field rather than turning a data field into one.

Once the configuration is saved, make a call to the endpoint GET /subscriber/meta to check if the values entered match the values from the call's response. Below is an excerpt from the GET /subscriber/meta response after managing the list validated fields within Data Field Captions:

"pay_rate": {
                "update": true,
                "required": false,
                "caption": "Pay Rate",
                "data_type": "NUMBER",
                "validation_data": [
                    [
                        "20",
                        "20"
                    ],
                    [
                        "40",
                        "40"
                    ],
                    [
                        "80",
                        "80"
                    ]
                ]
            }