Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
fenjas72
Contributor II
Contributor II

Cloning a bookmark from one app to another

Hi,

Is it possible to clone an existing bookmark from one app to another? I'm trying to do this using the Qlik Sense .NET SDK. I managed to get a bookmark using GetGenericBookmark() and re-create it using CreateBookmarkEx() within the same app but when doing so in another app, the bookmark though created lacks all the details i.e. no selections, set expressions, etc so pretty much useless. I'm pretty new to the api and Qlik Sense so I'm still trying to make heads or tails of it. 

I wrote a testing framework that uses bookmarks to return data that I wish to test mainly for data integrity purposes. Since we have multiple apps under different streams, it would be great if somehow we could clone the same bookmark across all apps.

If this is technically possible, I would really appreciate a working example in c#.

Thanks

 

 

 

 

Labels (1)
  • API

6 Replies
Ray_Strother
Support
Support

Hello ,

Here is a link that gives an option for cloning the app as what you are asking isn't possible.

https://community.qlik.com/t5/Official-Support-Articles/How-to-transfer-an-app-with-its-bookmarks-fr...

fenjas72
Contributor II
Contributor II
Author

Hi, unfortunately cloning the app is not an option. I'll see if I can create a bookmark from scratch.

I would have thought it would be possible to get the properties of an existing bookmark and then create a new bookmark object and assign to it the same properties.

Regardless, thanks for the help.

 

stefanstoichev123

Dealing with bookmarks is a "bit" of a pain.

 

Cloning a bookmark is not a simple process and there is no simple solution (as far as im aware). The main problem is the selections. When calling create bookmark method you can pass only the "metadata". Qlik will then get that metadata and create bookmark based on the current selections. And there is no way to pass the selections in the api.

 

The solution i have is to get the expression/set analysis that is in the bookmark metadata, "convert" it to field <-> value pairs (if any), get all the expressions used when the bookmark is created (if any) and after that apply the selections (one by one).

 

Once the selections are applied then you can create bookmark (by passing the metadata) and the new bookmark will technically be clone/copy of the existing bookmark.

 

Ive made an enigma.js mixin that should implement this workflow. Its JS code but can gives you an idea of the process

 

https://github.com/countnazgul/enigma-mixin/blob/68de1fb18f0718ff9a1f652348d8e14e9fd0cc6a/src/mixins...

 

Stefan

fenjas72
Contributor II
Contributor II
Author

Thanks man, will give it a try! Appreciated.

fenjas72
Contributor II
Contributor II
Author

@stefanstoichev123 Hi, somewhat late but since my last post, I built a .NET app, borrowing some of your code, to clone bookmarks amongst other things. It can also mass clone, delete, etc. It's tailored made for our environments but if I'm allowed, I'll tone it down and post it to github one of these days. Occasionally there are some issues with parsing set analysis / expressions but in the most part it works and saves me (us) a ton of work since I often need to clone bookmarks across multiple apps / envs. It also works across different environments ex. from dev to production.

fenjas72_1-1726665151587.png

 

stefanstoichev123

@fenjas72 its great to hear that the approach is working! 🙂

 

P.S. the tool also looks great! imo i think thats how QS is supposed to be used (apart from the "dashboarding")