# QArray

**Methods**

* void addItem(QData qData)
* QData removeAt(int index)
* boolean remove(QData qData)
* QData getItemAt(int index)
* QData getItemByKey(String keyValue)
* QData getItem(String matchDataName,Object matchObj)
* QData getItem(String matchDataName,String operator,Object matchObj)
* QArray getItems(String matchDataName,Object matchObj)
* QArray getItems(String matchDataName,String operator,Object matchObj)
* QStringArray findMatchingItemStr(String matchDataName,QStringArray keyArray,String targetDataName)
* QIntegerArray findMatchingItemInt(String matchDataName,QStringArray keyArray,String targetDataName)
* QArray filterData(String inExp)

Filter Data is used to extract data with an expression.&#x20;

Some examples:

| Expression  | Description                       |
| ----------- | --------------------------------- |
| 1,4,6       | Returns 1st, 4th & 6th objects    |
| 1-3,5-7,10  | Returns 1,2,3,5,6,7 & 10          |
| ItemA,ItemB | Retuns key matching, ItemA, ItemB |

Note: if the item in given position or with matching key, exception will be thrown.&#x20;

* boolean hasItemWithKey(String keyValue)
* Integer getSize()
* boolean isEmpty()
* String toJson()
* String toJson(String keyName)
* QData toQData(String keyName,String valueName)
* void invokeDataModifiers(TFStepContext tfStepContext,TFProductElement tfProductElement)
* boolean doAssert(TFStepContext tfStepContext,String fieldName,QArray targetList)
* double sum(String sumDataName)
* double sumIf(String matchDataName,Object matchObj,String sumDataName)
*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.qatts.com/automation/objects/product-element/advanced-data-types/qarray.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
