Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Highlighted
Partner
Partner

GetListObjectData "Error in set modifier element function"

Hello, I am trying to get a list of the possible field values from my QlikSense app by using the Engine API. Normally, this isn't a problem, but I am trying to restrict the returned values according to what is possible for a specific test. The expression itself seems to be fine, but I keep seeing "Error in set modifier element function" in the logs. I am making the following calls:

Send out CreateSessionObject request

{

  "delta": true,

  "handle": 1,

  "method": "CreateSessionObject",

  "params": [

    {

      "qInfo": {

        "qType": "ListObject"

      },

      "qListObjectDef": {

        "qDef": {

          "qFieldDefs": [

            "=aggr(DISTINCT only({1<[TEST_NAME] = {'PSAT'}>} [YEAR]), [YEAR])"

          ],

          "qFieldLabels": [

            "none"

          ],

          "qSortCriterias": [

            {

              "qSortByNumeric": -1

            }

          ]

        },

        "qShowAlternatives": true,

        "qAutoSortByState": {

          "qDisplayNumberOfRows": 1

        }

      }

    }

  ],

  "id": 163,

  "jsonrpc": "2.0"

}

Receive the following response

{

  "jsonrpc": "2.0",

  "id": 163,

  "delta": true,

  "result": {

    "qReturn": [

      {

        "op": "add",

        "path": "/",

        "value": {

          "qType": "GenericObject",

          "qHandle": 68,

          "qGenericType": "ListObject",

          "qGenericId": "4063239e-9763-410e-b655-82a31ccebf55"

        }

      }

    ]

  },

  "change": [

    68

  ]

}

Send out GetListObjectData request

{

  "delta": true,

  "handle": 68,

  "method": "GetListObjectData",

  "params": [

    "/qListObjectDef",

    [

      {

        "qTop": 0,

        "qLeft": 0,

        "qWidth": 1,

        "qHeight": 1000

      }

    ]

  ],

  "id": 174,

  "jsonrpc": "2.0"

}

Receive the following error response

{

  "jsonrpc": "2.0",

  "id": 174,

  "error": {

    "code": 15,

    "parameter": "Failure",

    "message": "Request aborted"

  }

}

I went into the Service_Engine.txt log to see what error was causing this to error out and I got this:

CEvaluatedExpression::Evaluate Select -1 Error in set modifier element function


I tried creating a FilterPane in the app via the hub and adding the expression to it and it works fine. It is only when trying to get the values through API calls. Also, I make the same API calls elsewhere and it works fine. It is fairly random if QlikSense raises this error or not. Any explanation as to what could be causing this error would be helpful.

I am currently running the QlikSense November 2017 release.

1 Solution

Accepted Solutions
Employee
Employee

Re: GetListObjectData "Error in set modifier element function"

Are you sure the CEvaluateExpression::Evaluate error is really associated with your session object?

"Request aborted" errors are returned when a change to the engine state occurs when a calculation operation is in progress. Such state changes are typically caused by a selection begin made or data being reloaded. It is up to the client to decide how to deal with such cases, but a typical strategy would be to simply resend the request.

I actually think it is unfortunate that the aborted messages are returned as errors, as those errors are an expected part of a normal information flow with the engine,

View solution in original post

3 Replies
Employee
Employee

Re: GetListObjectData "Error in set modifier element function"

Are you sure the CEvaluateExpression::Evaluate error is really associated with your session object?

"Request aborted" errors are returned when a change to the engine state occurs when a calculation operation is in progress. Such state changes are typically caused by a selection begin made or data being reloaded. It is up to the client to decide how to deal with such cases, but a typical strategy would be to simply resend the request.

I actually think it is unfortunate that the aborted messages are returned as errors, as those errors are an expected part of a normal information flow with the engine,

View solution in original post

Partner
Partner

Re: GetListObjectData "Error in set modifier element function"

Thank you so very much. This was exactly what was going on. Unbeknownst to me, a Clear request was being sent in between the objects creation and its data retrieval.

{

  "delta": true,

  "handle": 38,

  "method": "Clear",

  "params": [],

  "id": 83,

  "jsonrpc": "2.0"

}

I took your suggestion and added a function to resend the request if it receives the "Request aborted" error (with a max of 10 attempts to prevent it from being called infinitely) and it returned results on the second call.


I really appreciate it, I've been stuck on this for two days

Employee
Employee

Re: GetListObjectData "Error in set modifier element function"

Great! I'm glad that solved it for you.

The "Request aborted" functionality is unfortunately a not very well document part of the engine API.