No ratings
Saviynt Employee
Saviynt Employee

Use Case

How to send out emails from analytics depending on the results of the analytics. In this use case, we're going to send a separate email to each user record of the analytic report. 


Email Template and Analytics

Applicable Version(s)




Please follow the below steps: 

a) Create an Analytic Report

  • Ensure the Analytic report contains a column called USERNAME. 
  • Ensure each row has a unique USERNAME (only one record per username), you can use the group_concat()  function based on your usecase. 
  • Example Analytic Query: 
SELECT DISTINCT u.username           AS USERNAME,
                Count(ua.accountkey) AS 'Count of Accounts in SSM'
FROM   users u,
       user_accounts ua
WHERE  u.userkey = ua.userkey
       AND u.userkey IN ( 12, 13 ) -- Test Data
GROUP  BY u.username

b) Modify the Email template used in the Analytic report

  • Set the Email 'To' field to: ${userEmail}
  • In the body of the email, use the  {$ANALYTICSDATA} and {$ANALYTICSDATAMAP} variables.  


  • You can also use ${ANALYTICSDATAMAP.get("REPLACE_COLUMNNAME_FROM_REPORT")}  to get column-specific data.

Results Example

Analytic Report Result: 


Three separate emails were sent out for all three records in the report: 


Note: The email will be sent to the email of users mapped with username is result.


Version history
Last update:
‎08/22/2023 06:31 AM
Updated by: