> For the complete documentation index, see [llms.txt](https://docs.apica.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apica.io/platform-docs/zebratester-scripting/apica-data-repository-adr-aka-apica-table-server/accessing-the-adr-with-inline-scripts.md).

# Accessing the ADR with Inline Scripts

Inline Scripts are how you access the Apica Data Repository

* There is a quickstart help for Inline Script Code included with ZT.
* The Inline Scripts page has the complete [Prx BASIC Language Reference Manual](https://apica-kb.atlassian.net/wiki/spaces/DAZT/pages/149291571/7.+Custom+Scripting+-+Inline+Scripts?preview=%2F149291571%2F151880255%2FPrxBasicLanguageReferenceManualEn.pdf\&search_id=64e7e343-2894-46e6-93eb-a67f30a5f04f) embedded in it for reference.

| <h3 id="accessingtheadrwithinlinescripts-step"><strong>Step</strong></h3>                                                                                                                                                                                                                                                                                                                                         | <h3 id="accessingtheadrwithinlinescripts-screenshot"><strong>Screenshot</strong></h3>   |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| Open a session (\*.prxdat) via the Project Navigator.                                                                                                                                                                                                                                                                                                                                                             |                                                                                         |
| Refresh the Main Menu to get to the Recorded session and click on any URL that you want values from the ADR to populate.                                                                                                                                                                                                                                                                                          |                                                                                         |
| On the Var Handler Column, find the Inline Scripts Row and click on “Add Inline Script” to open the Add Inline Script Dialog                                                                                                                                                                                                                                                                                      |                                                                                         |
| <p>Enter your Inline Script Code.</p><ul><li>Test it</li><li>Save it as a Template</li><li>Load a previous Template</li><li>Add it to the Session when satisfied.</li></ul>                                                                                                                                                                                                                                       |                                                                                         |
| <h3 id="accessingtheadrwithinlinescripts-example">EXAMPLE:</h3><p>This is an example of how an inline script can access ADR to fetch values for script execution. For a script, two inline scripts were written to access the ADR. We'll show a test of the second script.</p>                                                                                                                                    |                                                                                         |
| <h3 id="accessingtheadrwithinlinescripts-step.1"><strong>Step</strong></h3>                                                                                                                                                                                                                                                                                                                                       | <h3 id="accessingtheadrwithinlinescripts-screenshot.1"><strong>Screenshot</strong></h3> |
| <p><strong>View an Inline Script</strong></p><p>We opened up the link after URL #49 that we need a few ADR values from a session.</p>                                                                                                                                                                                                                                                                             |                                                                                         |
| <p>We see that this Inline Script called ‘<strong>setTableRowVar</strong>” that was set to execute after URL #49 inputs the ADR value of the country to the Var 1, 'team’</p><p><code>countries = team+";Moscow"</code><br><code>setTableRow("100\_Sales\_Reco</code></p><p><code>rds", "Country;Region", countries, "ROW")</code></p><p>We can Test or modify this script by clicking “Modify Inline Script”</p> |                                                                                         |
| <p><strong>Test Script with the “Test Script” button</strong></p><p>This allows you to test the execution of the inline script. The run time environment like URL Data, Cookies, and the Value of the Input Variables is simulated (initialized) based on the data of the recorded session.</p><p>We see that this ‘setTableRowVar’ script is for the <strong>Input Var</strong>, ‘team’</p>                      |                                                                                         |
| <p><strong>Set the Test Script parameters</strong></p><p>Note we can see where this script executes in the session</p><p>If needed, set the user/loop number and of the URL Call is Passed/Failed.</p><p>Click the “<strong>Execute Script</strong>” and wait for the server at 127.0.0.1 returns a result</p>                                                                                                    |                                                                                         |
| The Script result will be displayed as well as the Input Var Name value (in this case the countries from the input team and 'Moscow')                                                                                                                                                                                                                                                                             |                                                                                         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.apica.io/platform-docs/zebratester-scripting/apica-data-repository-adr-aka-apica-table-server/accessing-the-adr-with-inline-scripts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
