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
- Use the CMS Admin mode on your public site and hover over the AddOns menu.
- Scroll down and select Custom Session Variables.
- Select the New Custom Session Variable button.
- Decide which field you will use for your filter and then select the Object that's associated with your field.
- Select the field that you will use for your filter.
- 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.
- In the CMS menu select Content | Pages to select an existing page or create a new page for your stakeholder page
- Select Show Advanced Settings
- Under Visibility by session vars
- Select your Session Variable
- Select the appropriate Operator like Is Equal To or Contains
- Enter the value from your field that you want the page to use as a filter
- Select Add
- 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.
- In the CMS select AddOns | Custom Forms | Form Builder
- Create a new form or select an existing one that would be used to grant approval
- Be sure Sync Data with Salesforce, Populate fiels from Salesforce and Update Record are enabled
- Add the necessary fields that will be used to grant the Contact's approval
- Select Show Advanced Settings at the bottom of the form
- Under Enforce Session Parameters
- Select the appropriate field on your Object that will be used for the form's filter
- Select your Operator like Is Equal To
- 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.
- In the CMS go to Menus | Main Menu | Navigation
- Select an existing Menu Item or create a new one by selecting Create New Menu Item
- Add a Menu Name
- Select your page or add the URL
- Select your Parent Menu
- Select the order of this menu
- Visible to: Select Logged Users by Session Variable
- Select your Session Variable
- Select the appropriate Operator like Is Equal To or Contains
- Enter the value from your field that you want the page to use as a filter
- Select Add
- 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.
- Using the steps above, create a page for your Listing Block that will show Contacts awaiting approval.
- In the CMS go to Blocks | Listing CMS | Add Block
- Add a Name and select the appropriate Regions (Internal Pages - Main Content, Mobile, Tablet).
- Source = Salesforce Views
- Salesforce Object = Object associated with your data
- Salesforce View = List View that includes the necessary fields that you want to display on the public site
- 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.
- In the CMS go to Blocks | Search Results | Add Block.
- Add a Name and select the appropriate Regions (Internal Pages - Main Content, Mobile, Tablet).
- Configure your Search Block settings
- 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