# Store Target and Post-Processing

The **Store** tab in the Scenario Editor allows you to define extractors that listen for a specific Step and Request and extract data from its response.

When creating a **Store** or **Assert** entry in the Scenario Editor, you must configure the **Target** according to the type and format of the response.

You can also apply **post-processing** to the extracted value. Post-processing allows you to transform, encode, decode, or otherwise manipulate the value before it is stored or used by the scenario.

This document provides examples of the values that can be used for the **Target** and **Post-processing** fields.

## Post-Processing

Post-processing functions operate on the value extracted by the Target.

The `<span class="editor-theme-code">value()</span>` function represents the value extracted by the configured Target.

Examples:

- `<span class="editor-theme-code">substring(value(), 0, 2)</span>` — returns a substring of the extracted value.
- `<span class="editor-theme-code">URLEncode(value())</span>` — URL-encodes the extracted value.
- `<span class="editor-theme-code">URLDecode(value())</span>` — URL-decodes the extracted value.
- `<span class="editor-theme-code">append(value(), "-abc123")</span>` — appends the specified string to the extracted value.
- `<span class="editor-theme-code">length(value())</span>` — returns the length of the extracted value.
- `<span class="editor-theme-code">URLParam(value(), 'id')</span>` — extracts the specified URL parameter from the value.

## Target

The **Target** field supports different syntaxes depending on the type of response being processed.

The Target hint text in the Scenario Editor can change dynamically according to the selected target type.

The `<span class="editor-theme-code">//</span>` characters indicate a comment and are not part of the Target syntax, except for **HTML Targets**, where `<span class="editor-theme-code">//</span>` is part of the XPath expression.

### Default Targets

The following Targets can be used with any supported response:

- `<span class="editor-theme-code">duration</span>` — returns the request duration.
- `<span class="editor-theme-code">responseCode</span>` — returns the HTTP response status code.
- `<span class="editor-theme-code">size</span>` — returns the response size in bytes.
- `<span class="editor-theme-code">md5</span>` — returns the MD5 checksum of the response.

### HTTP Targets

For example, given the following response:

`<span class="editor-theme-code">data=45, data=68</span>`

You can use:

- `<span class="editor-theme-code">raw/data[0]</span>` — returns `<span class="editor-theme-code">data=45</span>`.
- `<span class="editor-theme-code">raw/data[1]</span>` — returns `<span class="editor-theme-code">data=68</span>`.
- `<span class="editor-theme-code">#data</span>` — returns `<span class="editor-theme-code">45</span>`.
- `<span class="editor-theme-code">Header:Accept</span>` — returns the value of the `<span class="editor-theme-code">Accept</span>` header.
- `<span class="editor-theme-code">CookieValue:CSRF-TOKEN</span>` — returns the value of the `<span class="editor-theme-code">CSRF-TOKEN</span>` cookie.

### HTML Targets

Use standard XPath expressions to extract values from HTML responses.

For HTML Targets, the `<span class="editor-theme-code">//</span>` at the beginning of the Target is part of the XPath and is required.

Example:

- `<span class="editor-theme-code">//input[@name='__RequestVerificationToken']/@value</span>`

This Target returns the value of the `<span class="editor-theme-code">value</span>` attribute of the matching input element.

### JSON Targets

Use JSON paths to extract values from JSON responses.

For example, given a JSON response containing an `<span class="editor-theme-code">employees</span>` array:

- `<span class="editor-theme-code">employees[0].address.city</span>` — returns the city of the first employee.
- `<span class="editor-theme-code">[2].carousel.images[1].path</span>` — returns the `<span class="editor-theme-code">path</span>` value of the second image in the carousel of the third element.

### PDF Targets

The following Targets can be used to extract information from PDF responses:

- `<span class="editor-theme-code">document</span>` — returns all text in the document, excluding form text.
- `<span class="editor-theme-code">page[2]</span>` — returns all text from page 2, excluding form text.
- `<span class="editor-theme-code">documentforms</span>` — returns a JSON representation of the forms contained in the document.
- `<span class="editor-theme-code">regex:Once upon a .* ever after.</span>` — returns the text matching the specified regular expression, if found.

### String Targets

String Targets can be used to extract a portion of a response based on delimiters or positions.

For example, given the following response:

`<span class="editor-theme-code">The tested process returned: ID=ABCDEF.</span>`

Examples:

- `<span class="editor-theme-code">11,20</span>` — returns `<span class="editor-theme-code">processed</span>`.
- `<span class="editor-theme-code">ID=,false</span>` — returns `<span class="editor-theme-code">ABCDEF.</span>`
- `<span class="editor-theme-code">ID=,true</span>` — returns `<span class="editor-theme-code">ID=ABCDEF.</span>`
- `<span class="editor-theme-code">ID=,38,false</span>` — returns the portion of the response according to the specified delimiter and position.
- `<span class="editor-theme-code">ID=38,true</span>` — returns the portion of the response according to the specified position and inclusion option.

> **Note:** The exact behavior of positional String Targets depends on the Target syntax supported by the current AIQ version.

### Text Targets

For text responses, specify the Target as a regular expression.

Examples:

- `<span class="editor-theme-code">(?<=\\"__RequestVerificationToken\\" type=\\"hidden\\" value=\\")[a-zA-Z0-9\\-_]+</span>`
- `<span class="editor-theme-code">id=.*</span>`

The Target returns the text matching the specified regular expression.

### CSV Targets

CSV Targets allow you to extract values from responses formatted as CSV.

For example, given the following CSV data:

<table id="bkmrk-idnamestate1johncali"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th>id

</th><th>name

</th><th>state

</th></tr><tr><td>1

</td><td>john

</td><td>California

</td></tr><tr><td>2

</td><td>barry

</td><td>Nevada

</td></tr><tr><td>3

</td><td>stef

</td><td>Texas

</td></tr><tr><td>4

</td><td>karla

</td><td>New York

</td></tr></tbody></table>

Examples:

- `<span class="editor-theme-code">2,2</span>` — returns `<span class="editor-theme-code">barry</span>`.
- `<span class="editor-theme-code">last(),"name"</span>` — returns `<span class="editor-theme-code">karla</span>`.
- `<span class="editor-theme-code">,"name"</span>` — returns an array containing `<span class="editor-theme-code">name</span>`, `<span class="editor-theme-code">john</span>`, `<span class="editor-theme-code">barry</span>`, `<span class="editor-theme-code">stef</span>`, and `<span class="editor-theme-code">karla</span>`.
- `<span class="editor-theme-code">3,last()</span>` — returns `<span class="editor-theme-code">Texas</span>`.
- `<span class="editor-theme-code">id=3,2</span>` — returns `<span class="editor-theme-code">stef</span>`.

> **Note:** Make sure the indexing behavior used by CSV Targets matches the indexing convention of your AIQ version.

---

**Last updated:** August 12 2026

If you have any feedback about this topic, please contact <documentation@appvance.ai>.