# ViewItem

> Source: https://manual.pvxplus.com/views-system/views-definition-object/viewitem

**ViewItem** is a subordinate object used to define an item selected for the view. One object is defined for each item selected. Items can be data source items or calculated items. The **ViewItem** object corresponds to a record in the *pvxview.vue* file.

For information on the *pvxview.vue* file structure, see **[Views System File Structures](https://manual.pvxplus.com/views-system/views-system-file-structures/overview#vue)**. Properties are read only and are set using corresponding **Set*xxx*( )** methods.

## ViewItem Properties

The following table lists the properties of the **ViewItem** subordinate object:

| **Property** | **Description** |
| --- | --- |
| **Column$** | Column name (no trailing "$"). |
| **Condition$** | ***(Internal Use Only)***<br>Filter condition specific to the view item. Use **ViewCtl SetFilter( )** method. |
| **ItemType$** | Indicates the source of the item where:<br>\|  \|  \|<br>\| --- \| --- \|<br>\| "I" or blank \| Data source item \|<br>\| "C" \| Calculated item \|<br>*(ItemType$ property was added in PxPlus 2021.)* |
| **Path$** | Source linkage.<br>For calculated items, linkage is to the **[CalcItem](https://manual.pvxplus.com/views-system/views-definition-object/calcitem)** object ID.<br>For data source items, linkage consists of:  <br>  <br> \[*Link ObjID* \[+ *Link ObjID* …\]\] + **DS_Item** *ObjID*<br>Linkage begins just below the primary data source, resulting in the linkage for items from the primary data source consisting of the **DS_Item** *ObjID* alone. |
| **RawCondition$** | Raw condition data consisting of the condition code, case flag and up to eight comparison values all separated by $01$.  <br>  <br>***Example:***  <br>  <br> *Code$* + *$01$* + *Case$* + *$01$* \[+ *v1$* + *$01$* ...+ *v8$ \]*  <br>  <br>See the **[SetCondition$( )](https://manual.pvxplus.com/views-system/views-definition-object/viewitem#setcondition)** method for code and case flag values. |

## ViewItem Methods

The following table lists the methods of the **ViewItem** subordinate object:

| **Method** | **Description** |
| --- | --- |
| SetColumn(*Column$***)** | Set a column name (no trailing "$"). |
| SetCondition(*Code*, *Case* **\[,** *v1$* **…** *v8$* \])  <br>SetCondition(*Condition1$* **\|** *Condition2$***)** | Set a filter condition specific to the view item. (Use **ViewCtlSetFilter( )** method.)<br>\|  \|  \|<br>\| --- \| --- \|<br>\| *Code* - Condition indicator code: \|  \|<br>\| 1 \| Equal to \<Value1> \|<br>\| 2 \| Not equal to \<Value1> \|<br>\| 3 \| Less than \<Value1> \|<br>\| 4 \| Greater than \<Value1> \|<br>\| 5 \| Less than or equal to \<Value1> \|<br>\| 6 \| Greater than or equal to \<Value1> \|<br>\| 7 \| Between \<Value1> and \<Value2> inclusive \|<br>\| 8 \| Between \<Value1> and \<Value2> exclusive \|<br>\| 9 \| Any of \<Value1>,\<Value1>, …\<Value1> \|<br>\| 10 \| None of \<Value1>,\<Value1>, …\<Value1> \|<br>\| 11 \| Contains \<Value1> \|<br>\| 12 \| Starts with \<Value1> \|<br>\| *Case* - Case sensitivity indicator: \|  \|<br>\| 0 \| Not case sensitive \|<br>\| 1 \| Case sensitive \|<br>*v1$...v8$* - Values to be used in comparison. Pass numeric values as string arguments.  <br>  <br>*Condition1$* - A single string consisting of code, case and optional values separated by $01$.  <br>  <br>***Example:***  <br>  <br> *Code$+$01$+Case$+$01$* \[ *+v1$+$01$...+v8$* \]  <br>  <br>The format of this condition matches the contents of the **RawCondition$** property.<br>*Condition2$* - A simple PxPlus conditional expression:  <br>  <br>***Example:***  <br>  <br> CST_BALANCE>0   <br>  <br>This format is ***not*** recommended, as it only supports a restricted number of expressions.<br>Note:   <br>View item-level filters are analyzed at run time to optimize data retrieval by determining key ranges for reading records. |
| SetPath(*Path$***)** | Set the source linkage.<br>For calculated items, the linkage is to the **[CalcItem](https://manual.pvxplus.com/views-system/views-definition-object/calcitem)** object ID.<br>For data source items, linkage consists of:  <br>  <br> \[*Link ObjID* \[+ *Link ObjID* …\]\] + **DS_Item***ObjID*   <br>  <br>Linkage begins just below the primary data source, resulting in the linkage for items from the primary data source consisting of the **DS_Item** *ObjID* alone.  <br>  <br>**ViewItem** objects must be grouped sequentially based on their linkage path. If it is possible that a **ViewItem** object is out of sequence based on the value in its **Path$** property, use the **ViewDefAdjustItemSequence( )** method to adjust the sequence of the objects. |
| SetType(*Type$***)** | Set the type of data where:<br>\|  \|  \|<br>\| --- \| --- \|<br>\| "I" or blank \| Data source item \|<br>\| "C" \| Calculated item \|<br>*(SetType method was added in PxPlus 2021.)* |
