Tracking Portal User Metrics (first and last login)

To help determine engagement and use, we have added a field in Salesforce that captures the portal user's (e.g., volunteer, partner staff) first and last login date and time.   

The last login field is called Last Session Start because it captures the last time the user initiated a session.  This is because the user can log in and keep a session open for several hours or days.   Hence, the last login may have been several days ago, but the user may be using the portal today without having logged in today.

Note that the data captured is not retroactive.  The data capture started when this feature was activated on your HandsOn Connect or LlamaSite for Salesforce instance.  For most customers, this is September 7, 2023.

The metrics field in Salesforce is updated once a day.   

User Metrics Field in Salesforce

Portal User Metrics is the field that captures the user metrics in the Contact object.  Depending on whether you have HandsOn Connect (HOC), LlamaSite for Salesforce (LLS), or both installed, you may have two fields with the same name.  The prefix on the field's API name will tell you which app the field tracks:

  • HOC: HOC__Portal_User_Metrics__c
  • LlamaSite for Salesforce: LLS__Portal_User_Metrics__c

The data is captured in the following format:


An example value would look like this: FirstLogin=2021-09-20T21:16:00Z;LastSessionStart=2023-06-19T18:06:53.00Z

How to extract First Login into its own field

To extract First Login into its own field, use a date/time formula field with the following formula:

For HandsOn Connect (HOC)

DATETIMEVALUE(IF(LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(LEFT({HOC__Portal_User_Metrics, FIND(";", HOC__Portal_User_Metrics) -1 ), "FirstLogin=", ""),"Z",""),"T"," ")) > 10, (SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(LEFT(HOC__Portal_User_Metrics, FIND(";",HOC__Portal_User_Metrics) -1 ), "FirstLogin=", ""),"Z",""),"T"," ")) , null))

For LlamaSite for Salesforce (LLS)

DATETIMEVALUE(IF(LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(LEFT({LLS__Portal_User_Metrics, FIND(";", LLS__Portal_User_Metrics) -1 ), "FirstLogin=", ""),"Z",""),"T"," ")) > 10, (SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(LEFT(LLS__Portal_User_Metrics, FIND(";",LLS__Portal_User_Metrics) -1 ), "FirstLogin=", ""),"Z",""),"T"," ")) , null))

How to extract Last Session Start (last login) into its own field

To extract First Login into its own field, use a date/time formula field with the following formula:

For HandsOn Connect (HOC)

DATETIMEVALUE(IF( LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE((RIGHT(HOC__Portal_User_Metrics, LEN(HOC__Portal_User_Metrics) - FIND(";", HOC__Portal_User_Metrics))), "LastSessionStart=", ""),"Z",""),"T"," ")) > 10, (SUBSTITUTE(SUBSTITUTE(SUBSTITUTE((RIGHT(HOC__Portal_User_Metrics, LEN(HOC__Portal_User_Metrics) - FIND(";", HOC__Portal_User_Metrics))), "LastSessionStart=", ""),"Z",""),"T"," ")), null))

For LlamaSite for Salesforce (LLS)For HandsOn Connect (HOC)

DATETIMEVALUE(IF( LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE((RIGHT(LLS__Portal_User_Metrics, LEN(LLS__Portal_User_Metrics) - FIND(";", LLS__Portal_User_Metrics))), "LastSessionStart=", ""),"Z",""),"T"," ")) > 10, (SUBSTITUTE(SUBSTITUTE(SUBSTITUTE((RIGHT(LLS__Portal_User_Metrics, LEN(LLS__Portal_User_Metrics) - FIND(";", LLS__Portal_User_Metrics))), "LastSessionStart=", ""),"Z",""),"T"," ")), null))


Add your comment

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