cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trouble getting results from a previous task

rseibert1
Contributor
The below is giving a parse error, though it seems to be pulling a list of Id's that seems to be formatted wrong?
Trying to pull the list of Id's from the task.
 
{% for record in result("unhealthy_workers_table")["records"] %}
Id : {{ record.Id }}
{% endfor %}
 
 
[ERROR] 400: PARSE_ERROR. exceptionType: "DQL-ERROR-PARSING". syntaxErrorPosition: {"start":{"column":5,"index":4,"line":1},"end":{"column":5,"index":4,"line":1}}. errorType: "PARSE_ERROR". errorMessage: "`:` isn't allowed here. Please check the autocomplete suggestions before the error for alternative options.". arguments: ["`:`"]. queryString: "\tId : Workers-22\n\tId : Workers-23\n\tId : Workers-465\n\tId : Workers-349\n\tId : Workers-781\n\tId : Workers-621\n\tId : Workers-721\n\tId : Workers-722\n\tId : Workers-502\n\tId : Workers-501\n\tId : Workers-245\n\tId : Workers-84\n\tId : Workers-85\n\tId : Workers-86\n\tId : Workers-87\n\tId : Workers-143\n\tId : Workers-121\n\tId : Workers-62\n\tId : Workers-141\n\tId : Workers-142\n\tId : Workers-181\n\tId : Workers-182\n\tId : Workers-161\n\tId : Workers-162\n\tId : Workers-201\n\tId : Workers-202\n\tId : Workers-351\n\tId : Workers-352\n\tId : Workers-353\n\tId : Workers-354\n\tId : Workers-341\n\tId : Workers-342\n\tId : Workers-343\n\tId : Workers-344\n\tId : Workers-532\n\tId : Workers-321\n\tId  ---output truncated------------------------------------------------------
Workers-304\n". errorMessageFormatSpecifierTypes: ["INPUT_QUERY_PART"]. errorMessageFormat: "%1$s isn't allowed here. Please check the autocomplete suggestions before the error for alternative options.". queryId: "ddc63a6a-cf66-4e8a-98fb-1f795023b5fd"
 
Here is a sample from the unhealthy_workers_table:
 

[
{
"Id": "Workers-22",
"SpaceId": "Spaces-1",
"timestamp": "2024-12-04T11:39:52.487000000Z",
"HealthStatus": "HasWarnings",
"StatusSummary": "This machine is running an old version of Tentacle (6.1.1403).",
"WorkerPoolIds": [
"WorkerPools-42"
],
"OperatingSystem": "Microsoft Windows Server 2019 Standard 10.0.17763.0",
"HasLatestCalamari": true
},

 

There is no error in the previous DQL from what I can see, it formats nicely in notebook and looks like:

rseibert1_0-1733823375423.png

 

3 REPLIES 3

Hi, I had a similar issue by reading a json that seemed perfectly formatted but ended up in a similar error. I could fix it in this way:

data json: """{{ result("unhealthy_workers_table")["records"] | replace("'", "\"")}}"""

because " was the interpreted as '.

I tested it with your input (just kept 1 record):
data json:"""
{
"Id": "Workers-22",
"SpaceId": "Spaces-1",
"timestamp": "2024-12-04T11:39:52.487000000Z",
"HealthStatus": "HasWarnings",
"StatusSummary": "This machine is running an old version of Tentacle (6.1.1403).",
"WorkerPoolIds": [
"WorkerPools-42"
],
"OperatingSystem": "Microsoft Windows Server 2019 Standard 10.0.17763.0",
"HasLatestCalamari": true
}"""

But still it's not working. I found out that somehow the latest boolean value is disturbing the result reading.

If you modify to 0=false, 1=true it's going to work.

Very strange behaviour, both for "/' issue and for boolean one.

Hope this helps.
PF

Thanks Paolo, that helps a lot, I made a shorter DQL that omitted the field with the boolean and it works! 

Hi Paolo,

I am curious how you found the "  was being interpreted as ' ?  I am running into situations where some of my fields can be pulled in from previous tasks and some cannot.

I am especially seeing this trying to pull in records from a DQL execution into a JavaScript task.

Featured Posts