# Way to get the parameters associated with a named query?

**URL:** <https://forum.inductiveautomation.com/t/way-to-get-the-parameters-associated-with-a-named-query/60059>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [May 26, 2022, 12:42pm UTC](https://forum.inductiveautomation.com/t/way-to-get-the-parameters-associated-with-a-named-query/60059 "2022-05-26T12:42:45Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [May 26, 2022, 2:35pm UTC](https://forum.inductiveautomation.com/t/way-to-get-the-parameters-associated-with-a-named-query/60059/8 "2022-05-26T14:35:33Z")

</div>

This is where I ended up with, which I call with a `system.util.sendRequest`

```auto
def getNamedQueryParameters(payload):
	from com.inductiveautomation.ignition.gateway import IgnitionGateway
	project = payload['project']
	query = payload['query']
	namedQuery = IgnitionGateway.get().getNamedQueryManager().getQueryFromPath(project, query)
	parameters = namedQuery.getParameters()
	listOfParams = [param.getIdentifier() for param in parameters]
	logger.info(str(listOfParams))
	return listOfParams

```

And this logs exaclty what I need so I can utlize it.

I am testing it in script console now though and I actually am not getting the result - is that a known thing with testing sendRequest in script console?

```auto
project = 'PSM4_Project'
messageHandler = 'getNamedQueryParameters'
d = {'project':project, 'query':'forms/Customer/get'}
result = system.util.sendRequest(project, messageHandler, d)
print str(result)
print str(type(result))

```

Gives me None/NoneType, but I would expect the list of params that are logged. I assume it will work in the client, I just like to try to build these things in script console as I find it easier to debug and fix issues.

EDIT: Issue with sendRequest was of course my own mistake. I had

```auto
def handleMessage(payload):
	classes.helpers.getNamedQueryParameters(payload)

```

but needed

```auto
def handleMessage(payload):
	return classes.helpers.getNamedQueryParameters(payload)

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/way-to-get-the-parameters-associated-with-a-named-query/60059)._
