ALM – Variable library

A variable library provides a reusable way to configure references that are used by Plan items. Instead of selecting the same semantic model, database, or connection each time, you can define the reference as a variable and reuse it where supported. This article shows how to use a variable library with a Plan item by creating the following variables:

  • SM_Variable — an item reference to the Enterprise Dataset semantic model.

  • DB_Variable — an item reference to the My_Planning_DB SQL database.

  • DMTS_Variable — a connection reference to the My_Fabric_SQL_Connection connection, which uses the FabricSql connection type.

The example then uses these variables in the Enterprise_Plan Plan item. The semantic model is configured from SM_Variable, and the Writeback destination uses DMTS_Variable for the connection and DB_Variable for the database.

Create a variable library

Create a variable library in the workspace where you are developing the

Plan item.

  1. In your workspace, select New item.

  2. Create a Variable library item.

Screenshot showing the workspace with the option to create a Variable library.

  1. Enter a name for the variable library.

  2. Select Create.

In this example, the variable library is named Variables_1.

Screenshot showing the New Variable library dialog with the variable library name entered.

Create an item reference for the semantic model

Create an item reference variable that points to the semantic model used by the Plan item.

  1. In the variable library, select New variable.

Screenshot showing the New variable action in the variable library.

  1. Enter SM_Variable as the variable name.

  2. Select Item reference as the variable type.

Screenshot showing Item reference selected as the variable type.

  1. Select the item picker for the variable value.

  2. Select the Enterprise Dataset semantic model.

Screenshot showing the Enterprise Dataset semantic model selected as the variable value.

  1. Select Save.

Screenshot showing the saved semantic model variable in the variable library.

Create a Plan item

Create the Plan item that uses the semantic model variable.

  1. In the workspace, select New item.

  2. Select Plan.

Screenshot showing New item with Plan selected.

  1. Enter Enterprise_Plan as the Plan name.

  2. Select Create.

Screenshot showing the New Plan dialog with Enterprise_Plan entered as the Plan name.

Use the semantic model variable in the Plan

Configure the Plan item to use SM_Variable instead of selecting the semantic model directly.

  1. In the Plan creation flow, select Semantic Model.

Screenshot showing the Semantic Model option for the new Plan item.

  1. In the Select Semantic Model pane, select Variable Library.

  2. In Semantic Model, select Select from variable.

Screenshot showing Variable Library selected as the source for the semantic model.

  1. Select SM_Variable.

Screenshot showing SM_Variable selected from the variable library.

  1. Select Connect.

Screenshot showing the Connect button after selecting the semantic model variable.

The Plan is now configured to use the semantic model referenced by SM_Variable.

Screenshot showing the semantic model added to the Plan item.

Create an item reference for the SQL database

Create an item reference variable for the SQL database that you use as the Writeback database.

  1. In the variable library, select New variable.

  2. Enter DB_Variable as the variable name.

  3. Select Item reference as the variable type.

  4. Select the item picker for the variable value.

Screenshot showing the New variable action and Item reference selected for the database variable.

  1. Select My_Planning_DB.

Screenshot showing the SQL database item selected for DB_Variable.

  1. Select Save.

Screenshot showing DB_Variable saved in the variable library.

Create a connection reference for the App DB connection

Create a connection reference variable for the reusable App DB connection.

  1. In the variable library, select New variable.

  2. Enter DMTS_Variable as the variable name.

  3. Select Connection reference as the variable type.

  4. Select the connection picker.

Screenshot showing the New variable action with Connection reference selected for DMTS_Variable.

  1. Select My_Fabric_SQL_Connection.

  2. Select Save.

Screenshot showing My_Fabric_SQL_Connection with the FabricSql connection type selected.

Screenshot showing DMTS_Variable saved as a connection reference.

The variable library now contains reusable references for the semantic model, SQL database, and App DB connection.

Use the variables for a Writeback destination

Use DMTS_Variable and DB_Variable when you configure the Writeback destination in Enterprise_Plan.

  1. Open Enterprise_Plan.

  2. Select Planning.

Screenshot showing Enterprise_Plan opened with the Planning experience selected.

  1. Create a planning sheet.

Screenshot showing the New Planning Sheet dialog with the Create button.

  1. In the Writeback experience, select Add destination.

Screenshot showing the Add destination action for Writeback.

  1. In Create Destination, open the Select a Connection list.

Screenshot showing the Select a Connection list in the Create Destination pane.

  1. Select Use Variable.

Screenshot showing Use Variable selected for the connection.

  1. In the Select variable pane, select DMTS_Variable.

  2. Select Select variable.

Screenshot showing DMTS_Variable selected from the variable library.

  1. Under Select Database From, select Variable Library.

  2. In Database Name, select Select from variable.

Screenshot showing Variable Library selected as the source for the database name.

  1. Select DB_Variable.

  2. Select Select variable.

Screenshot showing DB_Variable selected from the variable library.

  1. Complete the remaining required destination fields, such as Schema and Table Name.

  2. Select Add.

Screenshot showing the completed Writeback destination configuration with variable-based connection and database values.

The Writeback destination is added to the Plan using the reusable variables.

Screenshot showing the Writeback destination added to the Plan.

Summary

In this example, the variable library centralizes the references

required by the Plan item:

Variable Type Reference
SM_Variable Item reference Enterprise Dataset semantic model
DB_Variable Item reference My_Planning_DB SQL database
DMTS_Variable Connection reference My_Fabric_SQL_Connection connection

The Plan uses SM_Variable for its semantic model and uses DMTS_Variable and DB_Variable when configuring the Writeback destination. This approach avoids selecting the same references directly each time they are required and provides reusable configuration for ALM scenarios.