Choice Manager (.NET)

In Relativity, choices are predetermined values of single and multi-choice list fields. You can perform operations on admin and workspace choices. For more general information, see Choices in the RelativityOne Documentation site.

The Choice Manager API exposes multiple operations you can use to programmatically manage choices in your Relativity environment. It includes the following features:

  • Supports create, read, update, and delete operations and mass operations on choices.
  • Provides helper endpoints used to sort choices, move choices in lists, and retrieve highlight colors and parent choices or fields.

As a sample use case, you could use the Choice Manager API to create choices used to perform specific operations in a custom application.

You can also use the Choice Manager API through REST. For more information, see Choice Manager (REST).

The Relativity.ObjectModel.SDK contains this API. For compatibility and package installation instructions, see Download the SDKs and NuGet packages.

Fundamentals for the Choice Manager API

Review the following information to learn about the methods, classes, and enumerations used by the Choice Manager API.

Guidelines for the Choice Manager API

Use these guidelines when working with choice fields:

  • Multi-choice fields allow choices to be arranged in a hierarchical fashion. For example, a choice named Important might have child a choice of Critical. Selecting the child choice on a field in the RDO layout also results in the parent choice being selected.
  • Single-choice fields do not allow for this arrangement of choices. Some endpoints only apply to multi-choice fields, or choices that are associated with multi-choice fields. Examples of this are the GetAvailableParentListAsync() methods. Requests to these made to these endpoints that reference single-choice fields will result in a status code 422 (unprocessable entity) response. See the method description details below for which methods are multi-choice only.

Create a single choice

The following code sample illustrates how to create a single choice asynchronously using the CreateAsync() method.

Mass create choices

The following code sample illustrates how to mass create choices asynchronously using the CreateAsync() method.

Read a choice

The following code sample illustrates how to read a single choice asynchronously using the ReadAsync() method. (To list the choices for a field, see Object Rule Manager service.)

Update a choice without a version check

The following code sample illustrates how to use the UpdateAsync() method modify information on a choice without performing a version check.

Note: After the choice is created, you cannot change the field associated with it.

Update a choice with a version check

The following code sample uses the UpdateAsync() method modify information on a choice. It performs a version check before applying the update. The update succeeds if the version token in the request matches that of the choice object in the environment. If the version tokens do not match, a status code 409 Conflict is returned.

Note: After the choice is created, you cannot change the field associated with it.

Update multiple choices

The following code sample illustrates how to use the UpdateAsync() method to modify multiple choices as a mass operation.

Delete a choice

The following code sample illustrates how to delete a single choice asynchronously.

Delete multiple choices

The following code sample illustrates how to mass delete choices asynchronously using the DeleteAsync() method.

Sort choices

The following code sample illustrates how to sort choices under the specified field in the specified direction using the SortAsync () method.

Move choices to start or end of list

The following code sample illustrates how to move a set of choices to either the start or end of the list of choices under a specific field using the MoveAsync() method by passing it the WorkspaceID, ChoiceObjectIdentifiers, and MoveListTo parameters.

Move choices after a specific choice in a list

The following code sample illustrates how to move a choice after a specific choice in a list of choices using the MoveAsync() method by passing it the WorkspaceID, ChoiceObjectIdentifiers, and ChoiceID parameters.

Retrieve a list of available parents

You can retrieve a list of available parents as follows:

  • Retrieve parents for a specific choice by passing the AvailableParentsListAsync() method a WorkspaceID, ChoiceGuid, and ChoiceID. See the code sample for Update a choice without a version check.

Retrieve a list of available colors

Use the GetColorsListAsync() method to retrieve a list of colors that can be assigned to choices. See the code sample for Create a single choice.