Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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'}>"}]}}
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.
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
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 😞
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:
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
@hugo_andrade I just tried with an empty first param, same issue 😞
Hey @dvasseur , simple questions:
=> yes, same 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
=> the app is a private one (My Work)
Thx !
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.
I'm connecting to the engine with port/certificate
bookmark def:
could you please share your custom code for connecting to Engine API with user sa_scheduler?
could you share entire response of GetBookmarks method?