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.
Pre-requisites
Email Template and Analytics
Applicable Version(s)
All
Solution
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 uaWHERE u.userkey = ua.userkey AND u.userkey IN ( 12, 13 ) -- Test DataGROUP BY u.usernameb) 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.
References
https://docs.saviyntcloud.com/bundle/EIC-Admin-v23x/page/Content/Chapter13-Access-Requests/ars-set-u...