Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Feb 24, 2022 9:50:12 AM
Nov 10, 2021 4:57:09 AM
By default, the logical model is always copied over when a Qlik Sense App is being copied, exported, or duplicated.
However, if you bypass the publishing step by allowing users to modify published apps (by means of modifying security rules for a stream), then the logical model might not be copied over. In that instance, review the below steps.
To solve the problem, they can use Repository API to publish & Approve these objects (see instructions).
How to publish & approve objects (QRS API) App object: Publish
POST /qrs/app/object/{id}/approve
POST /qrs/app/object/{id}/unapprove
Publish scenario
When you publish the App for the first time following objects are published & approved:
IEnumerable<AppObject> appObjects = _appObjectRepository.GetAll(o => o.App != null && o.App.ID == app.ID && o.Owner != null && o.Owner.ID == app.Owner.ID && o.ObjectType != ModelConstants.AppObject.TYPE_USERSTATE);
Export scenario
srcObjIDs = _appObjectRepository.GetAll(x => x.App != null && x.App.ID == id).ToList().Where(x => x.Published && x.Approved || x.ObjectType == "variable").Select(x => x.ID);
IEnumerable<Guid> segmentIds = _appDataSegmentRepository.GetAll(x => x.App != null && x.App.ID == id).Select(x => x.ID);
IEnumerable<Guid> internalIds = _appInternalRepository.GetAll(x => x.App != null && x.App.ID == id).Select(x => x.ID);
Duplicate scenario
Following AppObjects will be included into duplicated App
_appObjectRepository.GetAll(x => x.App != null && x.App.ID == srcApp.ID && x.Published && x.Approved).Select(x => x.ID)
srcObjIDs = srcObjIDs.Union(_appInternalRepository.GetAll(x => x.App != null && x.App.ID == id).Select(x => x.ID));
QB-5519