Use publishAs Public Version API

As an application designer or story developer, you can use the publishAs API for creating a public version from a private one.

Before You Start

Before using the publishAs API, make sure that you've checked the following:
  • You've created an application or optimized that contains a table and SAP Analytics Cloud planning model.

  • You've assigned the planning model to the table.

  • You've made up your mind on how to visualize or expose the publishAs API to the end users.

  • If users try to publish a version that exceeds the resource limits and there're not enough resources available in the system for the publishing operation, they'll see a corresponding message.

Via publishAs API you can specify the name for the new public version. Optionally, you can specify its category. If no category is specified, the category of the private version is used.

Example

In the following example, the private version myActual is published as a public budget version called newBudget when the script gets executed:
Sample Code
var myActualVersion = Table_1.getPlanning().getPrivateVersion("myActual");
if (myActualVersion) {
    myActualVersion.publishAs("newBudget", Category.Budget);
};