View approval in Employee center via url in the approval request email

Julia12
Tera Expert

Hi, 

I need help!!

I have created a custom app and it needs approval. In the approval request email, i need to create a url that can redirect the approver to the specific approval task in My Tasks in Employee Center. 

However, the My Tasks url is always /esc?id=hrm_todos_page, there is no sys_id associated to the specific approval task.

I have checked a couple of posts regarding custom the url, but it doesn't work and it always goes to the first approval task, not the specific one. Anyone has solutions?  Thanks!!

 

These are the posts i have checked:

 

https://www.servicenow.com/community/hrsd-forum/url-in-an-email-notification-to-portal-view-of-a-hr-...

https://www.servicenow.com/community/employee-center-forum/url-in-an-email-notification-to-esc-view-...

 

/ec?id=hrm_todos_page

3 REPLIES 3

mfhaciahmetoglu
Mega Sage

Hi @Julia12, have you found any answer to this? 

Hi @Julia12  and @mfhaciahmetoglu ,

I was able to create a URL in a notification script using the format "instance address + portal suffix + page name + table name + sys ID" and it works for me.  Hope it works for you as well.

var url = '<a href="' + gs.getProperty('glide.servlet.uri') +
    'esc?id=hrm_todo&sysparm_tableName=sysapproval_approver&sys_id=' + current.sys_id + '">' +
    'review the approval details at the Employee Center' + '</a>';
   
template.print(url);

 

Sarah

Thanks @Sarah Travis , works like magic. Thank you also to share the pathway.