---
title: "tmGetText2"
slug: "api/basket/operations/tmgettext2"
sidebar:
  order: 492
---

<a id="ref-4c0d242b95a6"></a>
<a id="ref-b34f47613c19"></a>
<a id="ref-3721b060d586"></a>

## Synopsis

```text
TMItem[] tmGetText2(
    SessionId sessionId,
    UUID[] itemIds,
    TMGetTextOptions? options)
throws BasketServiceFault;
```

See also: [`TMItem`](/pCon/configuratorOnline/specs/api/basket/types/tmitem#ref-4d7b23e91cc7), [`SessionId`](/pCon/configuratorOnline/specs/api/session/types/sessionid#ref-02e397c8fdb4), [`TMGetTextOptions`](/pCon/configuratorOnline/specs/api/basket/types/tmgettextoptions#ref-3abc12cddf13), [`UUID`](/pCon/configuratorOnline/specs/guide/web-service-interfaces/common-type-definitions/uuid), [`BasketServiceFault`](/pCon/configuratorOnline/specs/api/basket/faults/basketservicefault)

Operation `tmGetText2` is intended to replace [`tmGetText`](/pCon/configuratorOnline/specs/api/basket/operations/tmgettext) which isn't able to return formatted text.

In addition to being able to return formatted text, `tmGetText2` also allows a single operation to return texts for multiple basket items or multiple view items.

Parameter `options` is optional. Default values apply if no options parameter is specified.

Individual options are:

- `textFormat` and `preservePlainText` -- controls the format of the returned text with the same semantics and default values as described for operation [getItemProperties](/pCon/configuratorOnline/specs/api/basket/operations/getitemproperties); As for `getItemProperties`, `textFormat` must not be `None`.

- `languageMode` -- restricts the texts returned for individual rows; If Single, a single text is returned looked up based on the effective list of product data languages. If Alpha2, all available texts with `und` (the undetermined language) or just an ISO 639-1 (Alpha-2) code as their language tag are returned. If LangCode, all available texts are returned.

- The `language` field of [`TMText`](/pCon/configuratorOnline/specs/api/basket/types/tmtext) is set to the language tag of the stored text unless `languageMode` is `Single` or the language tag is und, in which case the `language` field is not set.

- `productTextMode` -- controls the handling of rows representing product text (text types `Short`, Long, and Features); The following modes are available:

  - `ProductDataText` -- returns only text provided by OFML product data; User-provided texts are ignored.

  - `UserText` -- returns only user-provided text; Text from OFML product data is ignored.

  - `PreferUserText` -- returns user-provided text if available, and OFML product data text otherwise

  - `Omit` -- returns the rows but without text

  - `OmitRow` -- doesn't return rows containing product texts

  Despite the option's name, values `Omit` and `OmitRow` affect all item types, including folders and text items. Values `ProductDataText`, UserText, and `PreferUserText` affect only article items, and even then they make no real difference for set-article and user article items, which don't distinguish between product data and user texts.

The following options must be set for `tmGetText2` to return the same texts as operations [`tmGetText`](/pCon/configuratorOnline/specs/api/basket/operations/tmgettext) and `getItemProperties:`

- for `tmGetText:` `textFormat` not set, `preservePlainText` set to `false` (doesn't really matter), `productTextMode` set to ProductDataText, and `languageMode` set to `Single`, Alpha2, or `LangTag` depending on arguments `allLanguages` and `enableLangTags`

- for `getItemProperties:` `textFormat` and `preservePlainText` set the same way as in [`GetItemPropertiesOptions`](/pCon/configuratorOnline/specs/api/basket/operations/getitemproperties#ref-9f6740185de1), `languageMode` to Single, and `productTextMode` to `Omit`

If parameter `itemIds` is empty, the operation returns a single instance of [`TMItem`](/pCon/configuratorOnline/specs/api/basket/types/tmitem) with texts provided by the basket text manager. Field `itemId` of the returned `TMItem` represents the NIL UUID.

If parameter `itemIds` is non-empty and option view of the provided instance of [`TMGetTextOptions`](/pCon/configuratorOnline/specs/api/basket/types/tmgettextoptions) `has` not been set, all item IDs must be valid basket item IDs, and a set of selected basket items is constructed based on the given set of basket item IDs and the given item selection options (base class of `TMGetTextOptions`). For each selected basket item, the operation returns one instance of [TMItem](/pCon/configuratorOnline/specs/api/basket/types/tmitem), with its itemId set to the ID of the basket item.

If parameter `itemIds` is non-empty and option view of the provided instance of [`TMGetTextOptions`](/pCon/configuratorOnline/specs/api/basket/types/tmgettextoptions) has been set to a valid view ID, all item IDs must be item IDs used by that view. A set of selected view items is constructed based on the given set of item IDs and the given item selection options. For each selected view item, the operation returns one instance of [TMItem](/pCon/configuratorOnline/specs/api/basket/types/tmitem), with its itemId set to the ID of the view item.
