---
schema_version: "1"
id: 4f0a66562c976e0be51bf9d3d9dd22893d083c6835c741adb25ca41d7b370c74
title: Configure a Calculation Procedure for Looping (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_configure_a_calculation_procedure_for_looping.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_configure_a_calculation_procedure_for_looping.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 857f118dec8b8f01ffdb51834a3980481597e91ad89fa9fa8a954acdf85a242f
description: For the managed package runtime, make sure that your calculation procedure UI is set up for looping calculations, then configure looping variables.
products:
  - Omnistudio
release: "264"
---
# Configure a Calculation Procedure for Looping (Managed Package)

For the managed package runtime, make sure that your calculation procedure UI is set up for looping calculations, then configure looping variables.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

1. From the App Launcher, go to the Vlocity Calculation Procedures tab.
2. Select your calculation procedure from the list. On the record page, click the **Related** tab.
3. Click the name of the Calculation Procedure Version you're using.
4. Click the gear icon and select **Edit Object**.
    
    A new browser tab opens and you are in Setup, in the Object Manager, and on the Vlocity Calculation Procedure Version page.
5. Select **Page Layouts**, then select the page layout you're using.
6. Drag the following items from Fields onto the Vlocity Calculation Procedure Version Detail section:
    
    - **Enable Looping**
    - **Loop Specification**
7. Click **Save**.
8. Return to the browser tab for the Calculation Procedure Version you're using and refresh the browser.
9. Click the pencil icon for the **Enable Looping** field and check the **Enable Looping** box.
10. In the **Loop Specification** field, type a JSON value in this format:
    
    ```
    {"loopingStart":"StartVariableName","loopingEnd":"TermVariableName","loopingInterval":"IntervalVariableName"}
    ```
    
    The values must match the names of the variables you will set in the calculation procedure in the next step.
    
    For example:
    
    ![Enable Looping is checked, and Loop Specification is {"loopingStart":"StartVariableName","loopingEnd":"TermVariableName","loopingInterval":"IntervalVariableName"}.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/calcprocedure_loopingspec.jpg)
11. Click **Save**.
12. In your calculation procedure, create three variables with a Data Type of **Number** and a Precision of 0. The names must match the variables you set in the **Loop Specification** in the previous step.
    
    For example:
    
    ![Term is a Number variable with a Precision of 0.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/calcprocedure_loopingvariables.jpg)
13. Click **Save Calculation Procedure**.
    
    After looping is configured, you can create calculation steps using the `index` variable and the `PREVIOUS` function. See [The Looping Feature in Calculation Procedures (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_the_looping_feature_in_calculation_procedures.htm&release=264.0.0&type=5 "For the managed package runtime, looping calculations take a starting point, an endpoint, and an interval. At run time, the calculation procedure runs in a loop from start to end per interval. Each run uses the same input variables, plus an index variable that you can use in the calculation.").