Skip to Content

Documentation

Risk Cloud API: Update Field Configuration

When you create Fields in Risk Cloud, you have the ability to name them, label them, add selectable options, among many other configuration options. In this guide, we will walk through how to do the following via the Risk Cloud’s Field API:

  1. Get Field
  2. Update Field
    1. Case #1 Update Field Label
    2. Case #2 Update Field Select Values
    3. Case #3 Add or Remove Field Select Values

Prerequisites

1. Get Field

Retrieve the field that you want to update via this endpoint:

This endpoint has the following parameters:

Required Path ParameterRequiredDescription
fieldIdYesThe Field Id you want to get. Expecting string.
Query ParameterRequiredDescription
archivedNoWhether to get archived Field or not. Expecting true or false.

Response

The endpoint will return a Field object to be used in the next PATCH request.

Note

You can retrieve the Field Id via:

  1. Editing Field on Step Builder Page
  1. Find all Fields via

2. Update Field

At a high overview, you can update the field via this endpoint. It can be further broken down to these use cases (1) updating the Field Label and (2) updating the Field Select Values (3) adding or removing the Field Select Values.

This endpoint has the following parameters:

Required Path ParameterRequiredDescription
fieldId
YesThe Field Id you want to update.

2.1. Case #1 Update Field Label

After PATCH call to update the Select Label to Select Label NEW, the Field Label now accurately reflects the updated label.

Request

This endpoint has the following request body properties:

//Paste the response from the GET Field endpoint into the body and then update the "label" property
{
    "fieldType": <string: field type ex SELECT>,
    ...
    "label": <string: label ex Select Label NEW>,
    ...
    "validTypeForCalculationInput":<boolean: valid type for calculation input ex true>
}

Response

The endpoint will return the updated Field object.

2.2 Case #2 Update Field Select Values

After PATCH call to update Option 2 with value 2 to Option 3 with value 3, the Field Select Values now accurately reflects the updated select value.

Request

This endpoint has the following request body properties:

//Paste the response from the GET Field endpoint into the body and then update the "currentValues" property
{
    "fieldType": <string: field type ex SELECT>,
    ...
    "currentValues": [
        {
            "id": <string: current value id>,
            ...
            "textValue": <string: text value ex Option 1>,
            "numericValue": <double: numeric value ex 1.0>,
            "archived": <boolean: archived ex false>,
            "priority": <integer: priority ex 1.0>,
            ...
            "fieldId": <string: field id>
        }
        {
            "id": <string: current value id>,
            ...
            "textValue": <string: text value ex Option 3>,
            "numericValue": <double: numeric value ex 3.0>,
            "archived": <boolean: archived ex false>,
            "priority": <integer: priority ex 2.0>,            
            ...
            "fieldId": <string: field id>
        }
    ],
    ...
    "validTypeForCalculationInput": <boolean: valid type for calculation input ex true>
}

Response

This endpoint will return the updated Field object.

2.3. Case #3 Add or Remove Field Select Values

After PATCH call to remove Option 1 and create new Option 2, the Field Select Values now accurately reflects the updated select value.

Request

This endpoint has the following request body properties:

//Paste the response from the GET Field endpoint into the body and then update the "currentValues" property
{
    "fieldType": <string: field type ex SELECT>,
    ...
    "currentValues": [
        {
            "id": <string: current value id>,
            ...
            "textValue": <string: text value ex Option 1>,
            "numericValue": <double: numeric value ex 1.0>,
            "archived": <boolean: archived ex false>,
            "priority": <integer: priority ex 1.0>,
            ...
            "fieldId": <string: field id>
        },
        {
            //ADD CASE: Copy and paste an existing current value and update it as needed
        }
        //REMOVE CASE: Delete the existing current value
    ],
    ...
    "validTypeForCalculationInput": <boolean: valid type for calculation input ex true>
}

Response

This endpoint will return the updated Field object.