---
title: "How do I pass a parameter from one cell to be applied to a command"
description: "Passing a parameter from one cell to a command in Geneos involves using XPath expressions to extract cell values. This can be done by creating a command with the appropriate XPath and running it from the desired cell."
url: "https://docs.itrsgroup.com/docs/faq/geneos/4405445547025-geneos-how-do-i-pass-a-parameter-from-one-cell-to-be-applied-to-a-command/index.html"
---
## Related to

Pass values from cell to be available. Pass parameters, xpaths, get rowname into a command.

### Problem

1. I want to use a value in a cell to make available to a command.

### Possible Solutions

**Solution Root Cause 1** - Create a command and add the appropriate x-paths

Example

I have the following dataview and I want to pass the value of a cell into a command - as highlighted in the below screenshot

![Geneos- How do I pass a parameter from one cell to be applied to a command](https://docscdn.itrsgroup.com/faq/images/geneos/4405445547025-34552305017757-image.png)

The Below command will achieve this

```
<command name="Gateway Echo Test Xpath Table Cell">
    <targets>
        <target>/geneos/gateway/directory/probe/managedEntity/sampler/dataview/rows/row/cell</target>
    </targets>
    <userCommand>
        <type>script</type>
        <runLocation>gateway</runLocation>
        <args>
            <arg>
                <static>/bin/echo</static>
            </arg>
            <arg>
                <xpath>ancestor::gateway/directory/@name</xpath>
            </arg>
            <arg>
                <xpath>ancestor::probe/parameters/@HostName</xpath>
            </arg>
            <arg>
                <xpath>ancestor::managedEntity/@name</xpath>
            </arg>
            <arg>
                <xpath>ancestor::sampler/@name</xpath>
            </arg>
            <arg>
                <xpath>ancestor::dataview/@name</xpath>
            </arg>
            <arg>
                <xpath>@rowname</xpath>
            </arg>
            <arg>
                <xpath>@column</xpath>
            </arg>
            <arg>
                <xpath>@value</xpath>
            </arg>
            <arg>
                <xpath>state/@severity</xpath>
            </arg>
            <arg>
                <xpath>@managedEntity</xpath>
            </arg>
        </args>
    </userCommand>
</command>
```

Right click the desired cell and choose the command to run

![Geneos- How do I pass a parameter from one cell to be applied to a command](https://docscdn.itrsgroup.com/faq/images/geneos/4405445547025-34552305019677-image.png)

Result

![Geneos- How do I pass a parameter from one cell to be applied to a command](https://docscdn.itrsgroup.com/faq/images/geneos/4405445547025-34552352570909-image.png)

## Related Articles

- [What\_is\_an\_XPath](https://docs.itrsgroup.com/docs/geneos/current/processing/gateway-administration/geneos_xpath_ug/index.html#what-is-an-xpath)
- [X-paths extra information](https://docs.itrsgroup.com/docs/faq/geneos/115004022025-geneos-xpath-quick-guide-with-examples/index.html)


