Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
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
Stefan
Thanks man, will give it a try! Appreciated.
@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 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")