Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
dvasseur
Partner - Creator III
Partner - Creator III

QSE: GetSetAnalysis working but empty ?

HI,

I'm using the QSE JSON API to retrieve the bookmarks list of an app (GetBookmarks) and then I'm calling GetSetAnalysis on each bookmark to retrieve the selected values for each field. The GetSetAnalysis call itself is working, but the returned list is always empty. Checking the same app using Chrome dev tools and the websocket messages, the same call with the same params is returning the right values => I'm probably missing something, but what ?

GetBookmarks

call:
{"handle": 1, "method": "GetBookmarks", "params": {"qOptions": {"qTypes": ["bookmark"], "qData": {"title": "/qMetaDef/title", "sheetId": "/sheetId", "selectionFields": "/selectionFields", "creationDate": "/creationDate", "approved": "/approved", "published": "/published"}}}, "outKey": -1, "id": 2}

response (OK):
"jsonrpc":"2.0","id":2,"result":{"qList":[{"qInfo":{"qId":"ffff1727-97e8-440c-bd09-b9fa79af382e","qType":"bookmark"},"qMeta":{"title": ...

GetSetAnalysis:

call:
{"handle": 1, "method": "GetSetAnalysis", "params": ["$", "ffff1727-97e8-440c-bd09-b9fa79af382e"], "id": 3}

response => qSetExpression shouldn't be empty
{"jsonrpc":"2.0","id":3,"result":{"qSetExpression":""}}

call/response as extracted from chrome dev tools (qSetExpression is not empty):
{"delta":true,"handle":1,"method":"GetSetAnalysis","params":["$","ffff1727-97e8-440c-bd09-b9fa79af382e"],"id":78,"jsonrpc":"2.0"}
{"jsonrpc":"2.0","id":78,"delta":true,"result":{"qSetExpression":[{"op":"add","path":"/","value":"<appName={'___a'}>"}]}}

Labels (1)
  • API

1 Solution

Accepted Solutions
alex_colombo
Employee
Employee

Bookmarks stay in the apps, so you have to open all of them with data for looking for their values. Opening without data means to open without data model and fields.

View solution in original post

12 Replies
hugo_andrade
Partner - Specialist
Partner - Specialist

@dvasseur,

I think the key detail is that the Chrome request is using delta mode:

{"delta":true,"handle":1,"method":"GetSetAnalysis", ...}

So the response you see there is not the final qSetExpression string. It is a delta patch:

"qSetExpression":[{"op":"add","path":"/","value":"<appName={'___a'}>"}]

That means the effective value is actually:

<appName={'___a'}>

------

So the first thing I would check is whether your client is handling delta responses correctly.

If you use delta: true, you need to apply the patch operations before reading the value. If you want the plain value directly, test the same call without delta mode and make sure nothing else in your websocket client is forcing delta behavior.

Hope this helps. Please give it a like, mark it as Helpful or Solution if that was the case.

Live and Breathe Qlik & AWS.
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

dvasseur
Partner - Creator III
Partner - Creator III
Author

Hi @hugo_andrade

The websocket calls are just "OpenDoc" => "GetBookmarks" => "GetSetAnalysis" so no delta involved.

I've added "delta: True" to the call but same issue, response is empty 😞

hugo_andrade
Partner - Specialist
Partner - Specialist

Hi @dvasseur ,

I see. 

I think the main issue is the first parameter.

For GetSetAnalysis(qStateName, qBookmarkId), the first argument is the state name. For the default state, Qlik says it should be left empty.

Try 

{"handle":1,"method":"GetSetAnalysis","params":["","ffff1727-97e8-440c-bd09-b9fa79af382e"],"id":3}

$ is the default identifier in set analysis syntax, but in this API call the method expects a state name, and for the default state that should be an empty string.

That's what I found here: 

https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/EngineJSONAPI/Content/service-do...

 

qStateName

Optional. The name of the state to get set analysis expression for. If left empty, the default state will be retrieved.

String

 

Live and Breathe Qlik & AWS.
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

dvasseur
Partner - Creator III
Partner - Creator III
Author

@hugo_andrade I just tried with an empty first param, same issue 😞

alex_colombo
Employee
Employee

Hey @dvasseur , simple questions:

  • Are you open the same app on both chrome and your custom app?
  • Are you open the app with the same user from both chrome and your custom app?
  • Is the bookmark public and available to all the users?
dvasseur
Partner - Creator III
Partner - Creator III
Author

hi @alex_colombo 

 

  • Are you open the same app on both chrome and your custom app?

=> yes, same app

  • Are you open the app with the same user from both chrome and your custom app?

=> not the same user, my user when using chrome (and I'm the owner of the bookmark), INTERNAL\SA_SCHEDULER when using the API

  • Is the bookmark public and available to all the users?

=> the app is a private one (My Work)

Thx !

 

alex_colombo
Employee
Employee

How are you calling the APIs? Are you connecting to Engine directly with port and certificate or you are using a virtual proxy?
Could you please share a screenshot of the bookmark details created in the app?

I tried to replicate the issue, but using sa_scheduler and connected to Engine APIs with engine port and certificate I'm able to see the bookmark expression.

dvasseur
Partner - Creator III
Partner - Creator III
Author

I'm connecting to the engine with port/certificate

bookmark def:

dvasseur_0-1776759292943.png

 

alex_colombo
Employee
Employee

could you please share your custom code for connecting to Engine API with user sa_scheduler?
could you share entire response of GetBookmarks method?