Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

want to create analytics that send a users manager a notification

K_India
New Contributor III
New Contributor III

one analytic we are looking for to send a users manager a notification, if the user is in an HR based location and their employee id is either missing, incorrect or is identical to someone else.

can anyone suggest how to create it with query.

3 REPLIES 3

nimitdave
Saviynt Employee
Saviynt Employee

You can check this:

https://docs.saviyntcloud.com/bundle/SSM-Admin-v55x/page/Content/Chapter16-SSM-Analytics/Managing-An...

1. Create a sql query where you have columns with name username and email that will have respective managers username and email. Additionally you can have other columns too as per your need.

2. Have a email template where to field should be ${userEmail}. This will be evaluated to be the users email whose username and email is return in each record from sql query.

3. Use ${ANALYTICSDATA} to get handle of reports data. This is an array of records returned from the sql query.

K_India
New Contributor III
New Contributor III

I am not getting email notification,  when I run analytics and Email History Job (EmailHistoryJob)
following is my Sql analytics query and Email template

can anyone please help on this issue .
 
----SQL analytics query----
select
u.username,
u.firstname as 'First Name',
u.lastname as 'Last Name',
u.email as 'User Email',
u.employeeid as 'Employee ID',
u.locationdesc as 'Location',

(
select
u1.email
from
users u1
where
u.manager = u1.userkey
) as 'Manager Email' ,
(
select
u1.firstname
from
users u1
where
u.manager = u1.userkey
) as 'Manager First Name',
(
select
u1.lastname
from
users u1
where
u.manager = u1.userkey
) as 'Manager Last Name'
from
users u
where
u.locationdesc IN ('Aberdeen','Abilene','Bakersfield', 'CABedford Park','Beech Island','Brashier','Bridgeview','Temple','Woodridge','Athens','Cadron Creek','Canton Corporate','Canton','Cedar Rapids','Kalamazoo','Memphis','
Non Facility Specific','Olmsted Falls','Pine Bluff','Pioneer','Plant City','Raleigh','Turlock','Waynesville') AND u.employeeid IS NULL OR u.employeeid = '';

--email template----

From:xyz@abc.com
Name:Missing Information Manager Notification
To: my_email@gmail.com (for testing)
Subject: Missing Employee ID Notification for ${ANALYTICSDATA.'First Name'[0]} ${ANALYTICSDATA.'Last Name'[0]},

BODY:

<pre><pre><pre><pre><pre><pre><pre><pre><pre><pre><div>***This email is sent from an unmonitored mailbox. Please do not reply to this email, thank you.***

Dear ${ANALYTICSDATA.'Manager First Name'[0]} ${ANALYTICSDATA.'Manager Last Name'[0]},

This is to bring to your notice that following employee has missing or incorrect Employee ID.
</div></pre></pre></pre></pre></pre><span><ul><li>Employee Name: ${ANALYTICSDATA.'First Name'[0]}, ${ANALYTICSDATA.'Last Name'[0]}</li><li>Employee Username: ${ANALYTICSDATA.username[0]}</li><li>User Email: ${ANALYTICSDATA.'User Email'[0]}</li></ul><br></span></pre></pre></pre></pre></pre>

nimitdave
Saviynt Employee
Saviynt Employee

Email history job is not required for analytics emails, its required only workflow emails.

Please try like this:

1. have as sql query as below:

select 'Your username' as username, 'your email' as email, 'Testing123' as AccountName;

here your username in EIC users profile should have the email where you are expecting the email.

2. Now have a email template with to as ${userEmail}, Subject as Testing emails from analytics, Body as ${ANALYTICSDATA}. 

Check if the above setup works.