How to create a session table in Jitterbit App Builder
Introduction
All interactions with App Builder occur within the context of a web "session". A session is created when a user first visits App Builder. Subsequent requests from the same user are associated with the same session. This page shows you how to create a session table and associate it with a rule and an event.
Business use cases for sessions
The following are some of the ways in which sessions can be used:
-
Track and distinguish between authenticated users under the same account. For example, if two people are both signed in as an admin user, sessions allow you to track them individually.
-
Track multiple anonymous users.
-
Filter report criteria based on session.
Create a session table
You can create a session table from the data storage layer of your application:
-
Navigate to the App Workbench.
-
In the Quick Actions panel, click + Table.
-
Give the new table the name Session, and click Save.
-
Verify that a column with the name SessionID and the data type UUID was created and that it was designated as the primary key. (This should happen automatically.)
-
Under the Table panel, click More > Edge Case to see advanced options.
-
Under the Managed Settings section, use the Purpose dropdown to select Managed Table. Another dropdown, Managed Type, becomes visible. Click it and select Session.
-
Add additional columns needed for your session.
-
Click Enhance Table, then Proceed.
Next, you must create a custom event referencing an intrinsic App Builder event that runs when querying the table via the application UI. To do that, follow these steps:
-
Navigate to the App Workbench > Rules.
-
Under App Data Sources, select By Table. In the Tables panel, look in the list of tables to find the Session table you've created previously.
-
On the row of the Session table, click the icon under the Events column. The Data Storage Events dialog opens.
-
Click + Table Event. The Event page opens.
-
Give the new event the name "Filter" and click Save. An edit page opens.
-
Under the Actions panel, click Register. An Action dialog opens.
-
In the Type dropdown, select Plugin.
-
In the Plugin dropdown, select Create row on empty table. This plugin creates a new row if the Filter event returns no rows.
-
(Optional) Enter a description of the event in the Technical Help field.
-
Click the Save button.