---
title: "setPropertyValue"
slug: "api/basket/operations/setpropertyvalue"
sidebar:
  order: 453
---

<a id="ref-ff6cb4bdc352"></a>
<a id="ref-48af370bd798"></a>
<a id="ref-3ec214dd0389"></a>

## Synopsis

```text
string setPropertyValue(SessionId sessionId,
    BItemId itemId,
    string propClass,
    string propName,
    string value
    SetPropertyValueOptions? options)
throws BasketServiceFault;
```

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

The `setPropertyValue` operation is used to assign a new value to an editable property of an article.

The `itemId` parameter must identify an article item that is part of the basket item tree maintained by the basket service for the session identified by the `sessionId` parameter.

The `propClass` and `propName` parameters must identify an editable property of the article.

The `value` parameter contains the new property value.

If argument `options` is missing the operation behaves as before (all options controlling computation of change flags are effectively true).

For string properties that do not allow additional values the value must be equal to one of the values from the choice list.

For numeric properties and length properties, the string must consist of an optional minus sign (`-`) , followed by a sequence of one or more decimal digits, and, if the precision[^1] of the property is greater than zero, followed by a decimal point and one or more decimal digits, but no more than specified by the precision[^2]. If the property does not allow additional values and has no intervals then the value must be numerically identical to one of the values from the choice list. If the property has at least one interval then the value must be within one of the intervals, or, for OCD 4.0 and later, a member of the choice list.

Setting a property value usually involves the evaluation of the product data’s relation knowledge. The `setPropertyValue` operation has no effect if, for whatever reason, evaluation of the relation knowledge fails.

The `setPropertyValue` operation returns a string consisting of zero or more characters, each character indicating a particular side effect of the assignment of the new property value. The following characters are defined:

**S property **S**hown**

An additional property became visible.

**H property **H**idden**

A property that has been visible before has been hidden, i.e. became invisible.

**V other property **V**alue changed**

Assignment of the new property value caused a change of the value of another visible property.

**v invisible property **v**alue changed**

Assignment of the new property value caused a change of the value of an invisible property.

**U property value **U**nchanged**

Assignment of the new property value did not result in a change of the value of this property. One reason may be that the property was set to the original value. Another reason may be that the change was rejected.

**A property value **A**djusted**

Assignment of the new property value resulted in a change of the value of this property, but the new value is different from the assigned one. One reason may be that a numeric property value has been rounded to the precision of the property as specified by the product data.

**C **C**hoice list changed**

At least one of the property choice lists has changed.

**I **I**nterval changed**

At least one of the interval lists has changed.

**a position **a**dded**

Assignment of the new property value resulted in at least one position to be added to the basket item hierarchy.

**r position **r**emoved**

Assignment of the new property value resulted in the removal of at least one position from the basket item hierarchy.

**u other position needs **u**pdate**

Assignment of the new property value resulted in a change to at least one other position (in addition to the currently configured position).

In case of the ‘a’, ‘r’ and ‘u’ flags, the other position or positions affected always belong to the same hierarchy of composite articles (§[BasketItem](/pCon/configuratorOnline/specs/api/basket/types/basketitem#ref-1e1fbe880650) for more information). Other than that there are no guarantees, in particular there is no guarantee that the other position or positions are immediate sub-articles of the modified position.

A [`BasketServiceFault`](/pCon/configuratorOnline/specs/api/basket/faults/basketservicefault) is returned if any of the following conditions occurs:

- The `sessionId` parameter is not a valid string representation of an UUID or does not represent an open session.

- The `itemId` parameter does not represent an UUID.

- The `itemId` parameter does not identify an article item.

- The `propClass` and `propName` parameters do not identify an editable property.

- The property is a numeric or length property, but the new property value cannot be parsed as a decimal number.

- The property has a choice list and no intervals, does not allow additional values, and the new value is not a member of the choice list.

- The property has a choice list and at least one interval, the value is not within one of the intervals, and, for OCD 4.0 and later, the value is not a member of the choice list.

- Evaluation of relation knowledge failed due to invalid relation knowledge or a database access error.

[^1]: The precision is the value of the `decDigits` field of the `Property` structure.

[^2]: The Online Configurator may accept other number formats too, but formats other than the one described here may not be accepted by later versions of the Online Configurator.
