Session Variables
In NIM, session variables play a crucial role in maintaining state and user-specific information across different interactions. These session variables can be configured using filters and the built-in session variable functionalities within NIM. Filters allow for dynamic data manipulation and conditional logic to be applied when setting or updating session variables. For instance, a filter can be used to check if a certain condition is met before assigning a value to a session variable, ensuring that the state management is both flexible and context-sensitive. Built-in session variables provide a standardized way to handle common user attributes, such as session identifiers, user roles, and authentication tokens, streamlining the process of state management across various modules of the NIM environment.
In the following example, we demonstrate how to utilize the "sessionUserName" to retrieve a user's Active Directory (AD) email address and store it in a session variable named "sessionADmail". First, a filter can be set up to trigger when the "sessionUserName" variable is populated, typically during user login or authentication processes. This filter will call an AD lookup service, passing the "sessionUserName" as a parameter. Upon receiving the response from the AD service, which includes the user's email address, the filter will then assign this email address to the "sessionADmail" session variable. This approach ensures that the email address is readily available for use in subsequent interactions within the NIM environment, enabling personalized and efficient user experiences. By leveraging the power of filters and built-in session variables, NIM provides a robust framework for dynamic and context-aware state management.
Create a new filter called Session_AD_User_View
Your start table will be AD.Users
Create a parameter called currentUsername, leveraging the existing session variable sessionUserName
Add an expression to the table that leverages your new parameter, validating it against the sAMAccountName. The finall result should look like the following
Under Configuration > Variables > Session Tab, add a new entry with the following properties
Name: sessionADmail
Filter: Session_AD_User_View
Filter Column: mail
Required: false
Data Type: string
Description: Current AD User mail address