Custom Session Variables (CSV)

Custom Session Variables (CSV) is a feature that allows you to filter a page, form, menu, listing block, search block or Advanced Registration process using any field on the Contact or Account Object.  This feature is great when you need to display information on your public site to specific Contacts.

Creating a Custom Session Variable

  1. Use the CMS Admin mode on your public site and hover over the AddOns menu.
  2. Scroll down and select Custom Session Variables.
  3. Select the New Custom Session Variable button.
    1. Decide which field you will use for your filter and then select the Object that's associated with your field.
    2. Select the field that you will use for your filter.
    3. Make sure Active is checked and then select Save.

In the example above we are using the Profile Name field on the Contact object for filtering. This means if we wanted to create a page for only Partner Staff Contacts, we can use this Custom Session Variable.

Custom Session Variables can be created for custom fields created on the Contact or Account Object too. Simply create your custom field in Salesforce first and then use the steps above to create your Custom Session Variable using the new field.

There may be a delay of a few minutes before your new field appears as an option to select in the Custom Session Variable menu.

Using Custom Session Variables on Pages

Use Case Example: Organization needs a page that only stakeholders can view.

Using the steps above a Custom Session Variable has been created using the Role Contact field.

  1. In the CMS menu select Content | Pages to select an existing page or create a new page for your stakeholder page
  2. Select Show Advanced Settings
  3. Under Visibility by session vars
    1. Select your Session Variable
    2. Select the appropriate Operator like Is Equal To or Contains
    3. Enter the value from your field that you want the page to use as a filter
    4. Select Add
    5. Select Save Page

Now this page will only be visible to Contacts who's Contact Role contain Stakeholder.

You can use more than one Custom Session Variable in your page filter. By default the filter will use an AND logic, but there is an option to use custom logic for an OR statement. For example, Contacts who contain the Contact Role Stakeholder OR Contacts who contain the Contact Role Manager.

Using Custom Session Variables on Forms

Use Case Example: A stakeholder needs to grant a contact's approval before they can sign up for volunteer opportunities.

Using methods discussed earlier in this article, we'll use Custom Session Variables to hide pages, menus, and search blocks until the contact is granted approval. This use case usually has a compliance or orientation process that's required before a volunteer can participate.

  1. In the CMS select AddOns | Custom Forms | Form Builder
  2. Create a new form or select an existing one that would be used to grant approval
    1. Be sure Sync Data with Salesforce, Populate fiels from Salesforce and Update Record are enabled
  3. Add the necessary fields that will be used to grant the Contact's approval
  4. Select Show Advanced Settings at the bottom of the form
  5. Under Enforce Session Parameters
    1. Select the appropriate field on your Object that will be used for the form's filter
    2. Select your Operator like Is Equal To
    3. Select your Session Variable

Based on the image above the Contact's Organization would need to equal the current Account ID of the Stakeholder giving the approval. This ensures that stakeholders are only seeing data from contact's who are in their purview.

Using Custom Session Variables in Menus

Use Case Example: The page we created for stakeholders should appear in the site's main navigation menu, but only for stakeholders.

  1. In the CMS go to Menus | Main Menu | Navigation
  2. Select an existing Menu Item or create a new one by selecting Create New Menu Item
    1. Add a Menu Name
    2. Select your page or add the URL
    3. Select your Parent Menu
    4. Select the order of this menu
    5. Visible to: Select Logged Users by Session Variable
      1. Select your Session Variable
      2. Select the appropriate Operator like Is Equal To or Contains
      3. Enter the value from your field that you want the page to use as a filter
      4. Select Add
  3. Select Save Menu Item

Using the image above, we have created a new menu that'll only be visible to contacts who's Contact Role contain the Stakeholder.

Using Session Variables in Listing Blocks

A Listing Block is a great solution when you need to bring data from Salesforce and display it on the public site. Custom Session Variables allows you to filter the data so Contacts can only see information that relates to them.

Use Case Example: Stakeholders need to see a list of their Contacts awaiting approval.

Listing Blocks are not enabled by default. To enable this advanced block open a support case. In addition, Listing Blocks work with Salesforce List Views. Before creating a Listing Block, create a list view on the appropriate Object. Learn how to create a list view here.

  1. Using the steps above, create a page for your Listing Block that will show Contacts awaiting approval.
  2. In the CMS go to Blocks | Listing CMS | Add Block
    1. Add a Name and select the appropriate Regions (Internal Pages - Main Content, Mobile, Tablet).
    2. Source = Salesforce Views
    3. Salesforce Object = Object associated with your data
    4. Salesforce View = List View that includes the necessary fields that you want to display on the public site
    5. Display Format = Select how you want your data to appear

Since our stakeholders want to view a list Contacts awaiting approval, the selected object is Contact as shown in the image above. This list of Contacts will be displayed in a data table with a search function.

Using the Filters we will only show Contacts who are related to the same Organization as the current Account related to the Contact (stakeholder) viewing this Listing Block.

In this example we are using a session variable. However, Custom Session Variables can be used in the Value field too.

Using Custom Session Variables in a Search Block

Use Case Example: Approved volunteers are labeled by type to specify which opportunities they can volunteer for.

To accomplish this the Program Area (Local) field on the Volunteer Opportunity object is used for filtering. The Volunteer Type will match one of the values of the Program Area (Local) field on Volunteer Opportunities.

  1. In the CMS go to Blocks | Search Results | Add Block.
  2. Add a Name and select the appropriate Regions (Internal Pages - Main Content, Mobile, Tablet).
  3. Configure your Search Block settings
  4. In the Filters section select your Custom Session Variable for the Program Area (Local) field.

In the example above a Contact (volunteer) will only see Volunteer Opportunities that have a Program Area (Local) that matches their Volunteer Type.

Custom Session Variables can be used in the Program Area (Local), Impact Area (Local), Organization to Serve, and Participate in Event fields.

This article explains how you can use Custom Session Variables to accomplish a specific use case like only displaying pages, menus, data, volunteer opportunities, or forms to specific Contacts. The stakeholder use case is only used as an example. These features can be applied to accomplish other program objectives.

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.