---
schema_version: "1"
id: 0545ad2c7a18270a1f1cfcafde2dc604cd890c6af81dd6649ad30e471ce3f3ea
title: Adding Conditions to a Card State (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_adding_conditions_to_a_card_state.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_adding_conditions_to_a_card_state.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 541a0f800a5f8be13c5d039d3607d1bc89ece398bb6cb602e48ccced0f293c4c
description: For the managed package runtime, set conditions to determine which card state is displayed on a layout or to change appearance based on conditions. For example, on a card that displays policy information, one card state shows action links to update profile and account information for all policies, while another card state includes a renew action link if the policy is about to expire.
products:
  - Omnistudio
release: "264"
---
# Adding Conditions to a Card State (Managed Package)

For the managed package runtime, set conditions to determine which card state is displayed on a layout or to change appearance based on conditions. For example, on a card that displays policy information, one card state shows action links to update profile and account information for all policies, while another card state includes a renew action link if the policy is about to expire.

![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).

If a card has multiple states, it must have logical conditions that determine which state is displayed and when. For example, a card has an active state if there is data to display, and a blank or open state if there is no data and limited actions.

To add a condition to a card state:

1. In your org, click the App Launcher, click Vlocity Cards, and click a version of a card to open the Card Designer.
2. In the **Conditions** section of a card state, click **\+ Add Condition**.
3. To create basic conditions:
    
    ![image](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/card_state_condition_create.png)
    
    1. Select **AND** or **OR** from the dropdown preceding each condition:
        
        - Select **AND** if all conditions must be met.
            
            - For example, the policy status is purchased AND the expiration date is less than 31 days.
            
            ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)
            
            Note
            
            If there is only one condition, that condition must be met to display cards.
        - Select **OR** if any condition can be met.
            
            - For example, the policy status is closed OR the expiration date is less than 31 days.
            
            ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)
            
            Note
            
            If there is only one condition, that condition does not need to be met to display cards.
    2. Click into the first input field, from the list of data fields, select a data field to filter, such as \['DaysToExpiration'\].
    3. Select the operator from the dropdown in the middle column, such as <.
    4. In the last input field, enter the value to filter, such as 31.
    
    ![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_important.png)
    
    Important
    
    In an [LWC enabled card](https://help.salesforce.com/s/articleView?id=xcloud.os_creating_an_lwc_card_layout.htm&release=264.0.0&type=5 "For the managed package runtime, create an LWC card layout to enable Vlocity Lightning web components."), when adding `params` and `$root.vlocity` [context variables](https://help.salesforce.com/s/articleView?id=xcloud.os_cards_context_variables.htm&release=264.0.0&type=5 "For the managed package runtime, several variables are available across the framework to provide contexts to cards, data sources, flyouts, templates, and other components.") as values to check against in a condition, enclose them in double curly braces. For example, {{params.id}} and {{$root.vlocity.userAccountId}}.
    
    ![image](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/state_conditions_lwc_enabled_use_curly_braces_for_context_variables.png)
4. To build nested conditions:
    
    1. Click **\+ Add Group** after creating a condition, such as DaysToExpiration < 31.
    2. Click **\+ Add Condition** and enter values for all fields for each condition. You must create at least two conditions to form a group.
    3. Select **AND** or **OR** from the dropdown between conditions.
    
    For example, use the conditions feature to build the conditional expression DaysToExpiration < 31 AND ( PolicyType = Universal Life OR PolicyType = Universal Variable Life) to filter for policies about to expire, and whose policy type is either Universal Life or Universal Variable Life.
    
    ![image](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/card_state_condition_add_group.png)