Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

ANALYTICSDATA and ANALYTICSDATAMAP are not working in the email

Harsha
Regular Contributor II
Regular Contributor II

Hi Team or @rushikeshvartak @Dhruv_S @Manu269 ,

We are trying to create an email template for analytics which should fetch the info from analytics but that doesnt seem to be working I see below errors in the logs. can anyone help me how this can be fixed? 

Harsha_0-1708065085962.pngHarsha_1-1708065120990.png

Thank you,

Harsha

26 REPLIES 26

rushikeshvartak
All-Star
All-Star

Share result 

To get what variables are present to use in the email template, check using the below expression. By putting it in the email body, it will print all variable names with values, and then accordingly, you can use it:


${this.binding.variables.each {k,v -> println "$k = $v" + "" + "br" + ">"}}


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Harsha
Regular Contributor II
Regular Contributor II

Hi rushikesh,

I had tried that it gives below result just totalrecord n analyticsconfig:

Harsha_0-1708069372778.png

if I give ANALYTCSDATA it is throwing no such property error. Is it not supported in latest version? Please let me know if you have any sample that I can refer and replicate.

CR
Regular Contributor III
Regular Contributor III

@Harsha  what info need to print and template post ? will check and confirm


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Harsha
Regular Contributor II
Regular Contributor II

Hi @CR, @rushikeshvartak ,

Below is the sample template used in advanced HTML and CSS:

<html> <table style="background-color: #eeeeee;margin-left: auto;margin-right: auto;"> <tbody> <tr> <td style="background-color: #eeeeee;"> <table width="80%" align="center"> <tbody> <tr> <td style="height: 3px; background-color: #eeeeee;"></td> </tr> <tr> <td style="color: white; font-size: 24px;padding-top: 30px; padding-left: 24px; height: 130px;" bgcolor="#006050" width="10%"> <p style="font-family:Verdana; font-size: 30px; margin: 0px;padding-top: 20px"> <strong>Company logo <strong></p> <p style="font-family:arial;color: #ffffff;font-size: 15px;"> Guest Account Expiry Notification <p style="font-family:arial;color: #00cccc;font-size: 15px;margin-top: -1em"><br>Action Required by Manager</p> <br/> </td> </tr> <tr> <td style="height: 8px; background-color: #eeeeee;"></td> </tr> <tr> <td style="padding: 20px; font-size: 14px;" bgcolor="white"> <p style="font-family:arial">Hi Account responsible person, <br><br> This is a reminder that the Guest Account below that reports to you is going to expire after 3 days.<br> <tr> <td style="font-family:arial;padding: 20px; font-size: 14px;" bgcolor="white"><hr color="#006050"> <p style="font-family:arial;color: #006050;font-size: 15px;"><b><u>Account Details:</u></b> <br><br> <table border="1" align="center" > <tr > <th style="background-color:#006050;color: #ffffff">&nbsp&nbsp Account Name &nbsp&nbsp</th><td> &nbsp&nbsp${ANALYTICSDATA.'UserUsername'[0]}&nbsp&nbsp</td></tr> <tr><th style="background-color:#006050;color: #ffffff">&nbsp&nbsp Display Name &nbsp&nbsp</th><td>&nbsp&nbsp${ANALYTICSDATA.'Displaynameee'[0]}&nbsp&nbsp</td></tr> <tr><th style="background-color:#006050;color: #ffffff">&nbsp&nbsp Account Expiry date &nbsp&nbsp</th><td>&nbsp&nbsp${ANALYTICSDATA.'enddte'[0]} &nbsp&nbsp</td></tr><tr> <th style="background-color:#006050;color: #ffffff">&nbsp&nbsp Account Expires in days &nbsp&nbsp</th> <td>&nbsp&nbsp 3&nbsp&nbsp</td></tr> <tr></table> <p /> <br> <hr color="#006050"> <p style="font-family:arial;color: #006050;font-size: 15px;"><p style="font-family:arial;color: #006050;font-size: 15px;"> </td> </tr> <td style="color: white; font-size: 24px; padding-left: 5px; height: 35px;" bgcolor="#A8A9AB" width="25%"/> <p style="font-family:Verdana; font-size: 10px; margin: 0px;padding: 10px"><strong>©Company logo 2024</strong></p> <tr> </tr> </tbody> </table> </td> </tr> </tbody> </table> </html>

CR
Regular Contributor III
Regular Contributor III

@Harsha  you template not correct look like and send me correct html and Query also

if you going to create new template please check  enable Advanced HTML/CSS


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Harsha
Regular Contributor II
Regular Contributor II

Hi @CR,

Can you please highlight what is issue with format?

Thank you,

Harsha

CR
Regular Contributor III
Regular Contributor III

@Harsha  Most of the times "&nbsp&nbsp" this special character got printed in template

 


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Harsha
Regular Contributor II
Regular Contributor II

Hi @CR,

Thank you for pointing that out but I believe culprit is ANALYTICSDATA in the logs. I want the solution for that why it says no sucg property?

@rushikeshvartak   do you have any clue why this is occuring? 

Harsha_0-1708322115337.png

 

Thank you,

Harsha

 

CR
Regular Contributor III
Regular Contributor III

@Harsha  send me you report query and it is exiting template or new ? if new did you enable Advanced HTML/CSS ?


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Harsha
Regular Contributor II
Regular Contributor II

Hi,

yes advanced is enabled. For same report email template is attached. Below is the report query:

select u.username as UserUsername,u.displayname as Displaynameee,u.EMPLOYEETYPE,u.companyname,DATE_FORMAT(u.startdate,'%Y-%m-%d') AS 'Startdte',DATE_FORMAT(u.enddate,'%Y-%m-%d') AS enddte,u.departmentname,u.country,um.username as Username,um.email as 'ManagerEmail' from users u , users um where u.manager=um.userkey and u.EMPLOYEETYPE='****' and u.statuskey=1 and DATE_FORMAT(u.enddate,'%Y-%m-%d') = DATE_ADD(CURRENT_DATE(),INTERVAL +3 DAY)

Thanks,

Harsha

CR
Regular Contributor III
Regular Contributor III

@Harsha  try like below

select u.username as 'UserUsername',u.displayname as 'Displaynameee',u.EMPLOYEETYPE,u.companyname,DATE_FORMAT(u.startdate,'%Y-%m-%d') AS 'Startdte',DATE_FORMAT(u.enddate,'%Y-%m-%d') AS 'enddte',u.departmentname,u.country,um.username as Username,um.email as 'ManagerEmail' from users u , users um where u.manager=um.userkey and u.EMPLOYEETYPE='****' and u.statuskey=1 and DATE_FORMAT(u.enddate,'%Y-%m-%d') = DATE_ADD(CURRENT_DATE(),INTERVAL +3 DAY)


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Harsha
Regular Contributor II
Regular Contributor II

Hi,

Yes I tried as above too, still issue is persistant.

Thank you,

Harsha

CR
Regular Contributor III
Regular Contributor III

@Harsha  try below query , below  highlighted column should add  dont remove u.username

 

CR_0-1708332736331.png

 

 

select u.username, u.username as 'UserUsername',u.displayname as 'Displaynameee',u.EMPLOYEETYPE,u.companyname,DATE_FORMAT(u.startdate,'%Y-%m-%d') AS 'Startdte',DATE_FORMAT(u.enddate,'%Y-%m-%d') AS 'enddte',u.departmentname,u.country,um.username as 'MUsername',um.email as 'ManagerEmail' from users u , users um where u.manager=um.userkey and u.statuskey=1 and DATE_FORMAT(u.enddate,'%Y-%m-%d') = DATE_ADD(CURRENT_DATE(),INTERVAL +3 DAY)


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

username column alias should be in lower case,

SELECT u.username                           AS 'UserUsername',
       u.displayname                        AS 'Displaynameee',
       u.employeetype,
       u.companyname,
       Date_format(u.startdate, '%Y-%m-%d') AS 'Startdte',
       Date_format(u.enddate, '%Y-%m-%d')   AS 'enddte',
       u.departmentname,
       u.country,
       um.username                          AS username,
       um.email                             AS 'ManagerEmail'
FROM   users u,
       users um
WHERE  u.manager = um.userkey
       AND u.employeetype = '****'
       AND u.statuskey = 1
       AND Date_format(u.enddate, '%Y-%m-%d') =
           Date_add(CURRENT_DATE(), interval + 3 DAY) 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Harsha
Regular Contributor II
Regular Contributor II

Hi @rushikeshvartak ,

Thank you for replying tried that didnt work either.  I consistently see the same issue. Groovy.lang.MissingProperty: ANALYTICSDATA . why would that be happening? any idea?

Harsha_0-1708402581437.png

Thank you,

Harsha

Share report & email template config.

And make sure below is enabled in global config

rushikeshvartak_0-1708403515423.png

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Harsha
Regular Contributor II
Regular Contributor II

Hi @rushikeshvartak ,

yes group by username is enabled in global config. Also below email template is added after enabling the advanced HTML and CSS:

<html>
<style> ul,li{ font-family:arial; } .spelling-error{ text-decoration-line: underline; text-decoration-color: blue; color:blue } mark { background-color: yellow; color: black; } the, tde { border-style:solid; border-color: #96D4D4; background-color: white; padding: 20px; } </style>
<table style="background-color: #eeeeee;margin-left: auto;margin-right: auto;">
<tbody>
<tr>
<td style="background-color: #eeeeee;">
<table width="80%" align="center">
<tbody>
<tr>
<td style="height: 3px; background-color: #eeeeee;"></td>
</tr>
<tr>
<td style="color: white; font-size: 24px;padding-top: 30px; padding-left: 24px; height: 130px;" bgcolor="#006080" width="50%">
<p style="font-family:Verdana; font-size: 30px; margin: 0px;padding-top: 20px"> <strong>Company <strong></p>
<p style="font-family:arial;color: #ffffff;font-size: 15px;"> Company Account Expiry Notification
<p style="font-family:arial;color: #00cccc;font-size: 15px;margin-top: -1em"><br>Action Required by Line Manager</p>
<br/>
</td>
</tr>
<tr>
<td style="height: 8px; background-color: #eeeeee;"></td>
</tr>
<tr>
<td style="padding: 20px; font-size: 14px;" bgcolor="white">
<p style="font-family:arial">
Hi Account responsible person, <br><br> This is a reminder that the Company Account below that reports to you is going to expire after 3 days.<br>
<tr> <td style="font-family:arial;padding: 20px; font-size: 14px;" bgcolor="white"><hr color="#006080"> <p style="font-family:arial;color: #006080;font-size: 15px;"><b><u>Account Details:</u></b> <br><br> <table border="1" align="center" > <tr > <th style="background-color:#006080;color: #ffffff">&nbsp; Account Name &nbsp;</th><td> &nbsp; ${ANALYTICSDATA.'UserUsername'} &nbsp;</td></tr> <tr><th style="background-color:#006080;color: #ffffff"> &nbsp; Display Name &nbsp;</th><td>&nbsp; ${ANALYTICSDATA.'Displaynameee'} &nbsp;</td></tr> <tr><th style="background-color:#006080;color: #ffffff">&nbsp; Account Expiry date &nbsp;&nbsp;</th><td>&nbsp; ${ANALYTICSDATA.'enddte'} &nbsp;</td></tr><tr> <th style="background-color:#006080;color: #ffffff">&nbsp; Account Expires in days &nbsp;</th> <td>&nbsp; 3&nbsp;</td></tr> <tr></table> <p /> <br> <hr color="#006080"> </br>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</html>

 and below is the report query:

select u.username as 'UserUsername',u.displayname as 'Displaynameee',u.EMPLOYEETYPE,u.companyname,DATE_FORMAT(u.startdate,'%Y-%m-%d') AS 'Startdte',DATE_FORMAT(u.enddate,'%Y-%m-%d') AS 'enddte',u.departmentname,u.country,um.username ,um.email as 'ManagerEmail' from users u , users um where u.manager=um.userkey and u.EMPLOYEETYPE='*****' and u.statuskey=1 and  DATE_FORMAT(u.enddate,'%Y-%m-%d') = DATE_ADD(CURRENT_DATE(),INTERVAL +3 DAY)

Thank you,

Harsha

 

 

Please provide screenshot, There is config issue


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Harsha
Regular Contributor II
Regular Contributor II

Hi @rushikeshvartak ,

I am not sure which config  you meant but I have provided all of them please refer below screenshot:

Harsha_0-1708408543420.png

 

Harsha_3-1708408612755.pngHarsha_4-1708408631480.png

 

Harsha_5-1708408672032.png

 

Thank you,

Harsha

Please confirm analytics type is not runtime & save data option - need screenshots 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Harsha
Regular Contributor II
Regular Contributor II

Hi @rushikeshvartak ,

Thank you so much for helping me out.Analytics is not runtime. And yes save data was checked mark.Issue was solved with @CR's suggestion by not adding without aliasname  to u.username 

@CR thank you so much for the help.

Thank you,

Harsha

CR
Regular Contributor III
Regular Contributor III

@Harsha 

Please did you tried below query same as what ever i given ?

select u.username, u.username as 'UserUsername',u.displayname as 'Displaynameee',u.EMPLOYEETYPE,u.companyname,DATE_FORMAT(u.startdate,'%Y-%m-%d') AS 'Startdte',DATE_FORMAT(u.enddate,'%Y-%m-%d') AS 'enddte',u.departmentname,u.country,um.username as 'MUsername',um.email as 'ManagerEmail' from users u , users um where u.manager=um.userkey and u.statuskey=1 and DATE_FORMAT(u.enddate,'%Y-%m-%d') = DATE_ADD(CURRENT_DATE(),INTERVAL +3 DAY)

Please try once let me know it work, i tested yesterday only


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Harsha
Regular Contributor II
Regular Contributor II

Hi @CR,

It does work but what if I want to send the mail to manager? what I need to do in that case?

Thank you,

Harsha

CR
Regular Contributor III
Regular Contributor III

try cc in below binding variable and your mail should be include

${owner.email},Harsha@gmail.com


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

To : ${userEmail}
Cc : ${ANALYTICSDATA.'ManagerEmail'[0]}


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

CR
Regular Contributor III
Regular Contributor III

@rushikeshvartak 

I am using  ${owner.email} it working me, again i suggested below

https://forums.saviynt.com/t5/identity-governance/how-to-fetch-user-s-manager-email-in-email-templat...

To : ${userEmail}
Cc : ${ANALYTICSDATA.'ManagerEmail'[0]}

 

 


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.