runNamedQuery error unable to coerce to a map

My first question, is if am putting in the project name right because when I go to the manual, the project name seems to go first when gateway scoped.
Then I put the path, and then the params.

My next question is how am I supposed to be putting in datetime datatype parameters.
I tried '2024/09/08 07:00:00' as a string.
I tried using dates derived from system.date.now().

I think either a parameter is wrong or the call is not working.
I am trying to run from the script console.
I am working there for testing to make a gateway event script.

Because it says that it can't coerce to a map though, I have to think the issue is in the params most likely.

Show your script but usually I get this when I the params are not a dict.

You cannot. When the function signature for the different scopes is incompatible, you simply cannot run the actual gateway script code in the designer script console.

2 Likes

I see that it is trying to receive my path as the parameters.
It does not like that I tried to place the project name.

image

my script is like

today = system.date.midnight(system.date.now())
yesterday = system.date.addHours(today,-24)

params =  { 'place': 'Narnia', 'minDay': yesterday, 'maxDay':today}
data1 = system.db.runNamedQuery( 'myProjectName', 'folderName/queryName',params)

Consider placing your test code in a library function, and use my runInGateway decorator.

Then you can call that script function in the designer and it will run in the gateway, returning your result back to the designer.

2 Likes