# Passing Parameters - JSON Path and XML Path

TDO allows any value returned in a call to be referenced in a subsequent call using JSON Path or XML Path to query the results from the completed call.  The method used should match the protocol of the call being referenced (i.e., JSON Path for a JSON response and XML Path for an XML response). &#x20;

In this section, JSON Path is shown but can be replaced with XML Path in any example.

{% hint style="warning" %}
Note that both the prior example of filtering for a specific workset id, and passing the id from the prior call, are both valid methods of passing parameters.  In the prior example, we are asking for the workset id associated with a specific workset and version (ex: second\_workset 1.0).  In this example, we are specifying a specific return position in the response (give me the workset id from the first workset in the response message).

Which method you use to pass the parameters to the url or body of your call will depend on your specific situation.
{% endhint %}

JSON Path/XML Path queries and user guided parameters can be combined inside a single call.  In the example below, JSON Path is used to provide the workset ID in the URL and user guided parameters are used in the body to pass the user ID and password.

### Using JSON Path in the Rest call&#x20;

The clone workset call is shown below.  It is referencing the response message from the prior call (get\_all\_worksets) to get the workset ID.  This is combined with a user guided parameter at the end of the call to define the cloned workset name, as well as guided parameters in the body for the user ID and password.

<figure><img src="/files/JmMxSebhUri3LuZQ8o9Z" alt=""><figcaption><p>Combining JSON Path and User guided parameters</p></figcaption></figure>

The 'extract(act\_res\[retrieve\_workset],' language is used to define the response message to be parsed (it can be any activity in the workflow prior to the current activity). &#x20;

When the workflow is executed, the response will show in the execution log.  Note in the 5th line in the log, the 5th line shows the extract command has been replaced with the system ID for the workset to be cloned (68126a9d68da6160327aa80c) from the prior call's response.

<figure><img src="/files/HJ9rZ5k7e0Wq3wd5r03e" alt=""><figcaption><p>Execution Log</p></figcaption></figure>

### Using JSON Path in the Call Body

JSON Path can also be used in the body of the call to pass a value from the any prior response message.

In the workflow shown below, the first call is to get all determining attributes.  The second call, update determining attribute, uses the ID of the determining attribute in the body of the call.  In the entity section, this is shown on the 'id' line. The command given is to extract the 'id' value from the first item in the returned array from the 'get\_all\_da' call.

<figure><img src="/files/Uja7SPEdRxulMoDGtS3g" alt=""><figcaption><p>Using JSON Path in the body of the call</p></figcaption></figure>

When this is run, the execution log will display the results.

<figure><img src="/files/p3PacMEe7jkkZQsm5alY" alt=""><figcaption><p>Execution Log</p></figcaption></figure>

And the determining attribute that was updated now shows priorities set (the update was to add priorities).

<figure><img src="/files/4Cb3xzr154nDSVx9Xf0Q" alt=""><figcaption><p>Updated Determining Attribute.</p></figcaption></figure>


---

# 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.apica.io/platform-docs/test-data-orchestrator-tdo/user-documentation/workflow-guide/setting-up-a-rest-api-call/passing-parameters-json-path-and-xml-path.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.
