---
title: "convertToSetArticle"
slug: "api/basket/operations/converttosetarticle"
sidebar:
  order: 439
---

<a id="ref-42eee89db3e4"></a>
<a id="ref-e185b8d5b510"></a>
<a id="ref-cf001139da5e"></a>

## Synopsis

```text
string convertToSetArticle(SessionId sessionId,
    BItemId folderId,
    OperationMode opMode)
throws BasketServiceFault;
```

See also: [`SessionId`](/pCon/configuratorOnline/specs/api/session/types/sessionid#ref-02e397c8fdb4), [`BItemId`](/pCon/configuratorOnline/specs/api/basket/types/bitemid#ref-bccb6c926e5b), [OperationMode](/pCon/configuratorOnline/specs/api/basket/types/operationmode), [`BasketServiceFault`](/pCon/configuratorOnline/specs/api/basket/faults/basketservicefault#ref-d5adb74faa1b)

This operation converts the specified basket folder into a set-article. Upon successful completion, the folder item specified by the `folderId` parameter has been replaced by a new set-article item, all children of the folder item are now children of the set-article item, and a subset of the descendants of the set-article item (usually all) is part of the set-article. The item ID of the set-article item is returned.

The flags in the operation mode parameter `opMode` control the behaviour of the operation as described below.

The following list describes in detail how the set of parts of the new set-article is constructed, how special conditions are handled, and how the actual conversion of the folder to the set-article is finally done:

- Descendants of the folder that can never be part of a set-article due to their type are ignored (except for set-article items, see below).

- If at least one descendant is a set-article item, and the `breakUpSetArticles` flag is set in `opMode`, all such set-article items and their parts are added to the set of new parts.

- For each descendant that is neither a set-article item, a set-article part, or a sub-article item, add the item to the set of new parts.

- If at least one descendant is a sub-article item whose main article item is neither an element of the set of new parts, nor part of a set-article, and the `mainArticles` flag is set in `opMode`, then ensure that the main article items of all such sub-article items are elements of the set of new parts, adding them if necessary.

- If the set of new parts contains one or more set-articles, the set-articles are broken up and the set-article items are replaced in the set of new parts with the folders created in place of the set-article items.

- The new set-article item is created as an immediate sibling of the folder item, all children of the folder item are moved to the set-article item (including all their descendants), and the folder item is deleted.

- All items in the set of new parts become parts of the new set-article item.
