Forms
Download API definition:
This operation is a Technical Preview and is available for testing purposes only. Do not use in production.
PUT https://api.bentley.com/forms/iTwins/{iTwinId}/listGroups/{id}

Uploads a file to set or replace the tree of list options for a specific list group. List groups determine the options that appear in cascading list controls. Cascading list controls are dropdown lists where the available values in one list depend on the values chosen for the previous lists. A form definition's cascading list controls can reference a list group by its ID.

The file uploaded through this endpoint must be an Excel spreadsheet file (.xlsx). The first row of the file must be a header containing the names of the lists (one per column). Subsequent rows represent valid combinations of options, going from the first list to the last. Example:

Letter
Number
A
1
A
2
B
3
B
4

In this example, the first dropdown list control of the cascading list group would have two options for the user to choose from: "A" and "B". If neither is selected, the second list is disabled. If "A" is selected, then "1" and "2" become available for selection in the second list. Conversely, if "B" is selected, then instead "3" and "4" become available for selection in the second list.

Authentication

Requires Authorization header with valid Bearer token for scope itwin-platform.

For more documentation on authorization and how to get access token visit OAUTH2 Authorization page.

Request parameters

Name
Required?
Description
iTwinId
Yes

The ID of the iTwin that this list group being updated belongs to.

id
Yes

The ID of the list group to update.

Request headers

Name
Required?
Description
Authorization
Yes

OAuth access token with itwin-platform scope

Accept
Yes

Setting to application/vnd.bentley.itwin-platform.v1+json is recommended.

Response 200 OK

Indicates that the list group file was successfully uploaded. Returns the current contents of the list group.

json
{
    "listGroup": {
        "id": "876f3da1-ae96-4ab5-84b4-9fa059b6e2d4",
        "displayName": "Sample AB",
        "createdDateTime": "2024-08-21T15:44:09Z",
        "lists": [
            "Letter",
            "Number"
        ],
        "optionsTree": {
            "A": {
                "1": {},
                "2": {}
            },
            "B": {
                "3": {},
                "4": {}
            }
        }
    }
}

Response 401 Unauthorized

This response indicates that request lacks valid authentication credentials. Access token might not been provided, issued by the wrong issuer, does not have required scopes or request headers were malformed.

json
{
    "error": {
        "code": "HeaderNotFound",
        "message": "Header Authorization was not found in the request. Access denied."
    }
}

Response 404 Not Found

This response indicates that the specified list group or iTwin containing it does not exist or is inaccessible to the user.

json
{
    "error": {
        "code": "ListGroupNotFound",
        "message": "Requested list group is not available.",
        "target": "id"
    }
}

Response 422 Unprocessable Entity

Indicates that there is a problem with the request. Most likely issue: The file is not an Excel spreadsheet (.xlsx) file, or is missing a header in a column.

json
{
    "error": {
        "code": "InvalidListGroupRequest",
        "message": "Cannot upload list group file.",
        "details": [{
            "code": "InvalidRequestBody",
            "message": "Input file must be a valid .xlsx (Excel spreadsheet) file."
        }]
    }
}

Response 429 Too many requests

This response indicates that the user has sent too many requests in a given amount of time.

json
{
    "error": {
        "code": "TooManyRequests",
        "message": "More requests were received than the subscription rate-limit allows."
    }
}

Response headers

Name
Description
retry-after

The number of requests exceeds the rate-limit for the client subscription.

List Group Details Response

Name
Type
Description

List Group Summary

Name
Type
Description
id
String

The unique ID of this list group.

displayName
String

The name of this list group, as entered by its creator.

createdDateTime
Date-time, null

The date and time (UTC) when this list group's file was uploaded.

lists
String[], null

The names of the lists defined by this list group, from outermost (first) to innermost (last).

optionsTree

A recursive data structure defining the options available in these lists. Its properties can have any name. For each property in the outermost object, its key should be used as the name of an option in the first list, and its value is an object whose keys correspond to the options that become available in the second list when that particular first-list option is chosen, and so forth. This pattern continues down to the last list, whose options will be represented by properties with empty object values.

Dynamic Object

An object whose properties can vary depending on user customization within the project.

DetailedError

Contains error information and an array of more specific errors.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

details

Optional array of more specific errors.

Detailed Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error Detailed information.

Error

Contains error information.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error information.

Was this page helpful?