How to populate Request For name in Email notification

shaik_irfan
Tera Guru

Hello Everyone,

i want to populate Requested By name under Email template, Requested For (u_req_for) is from RITM table which should be populated on Template i tried Select Variables which is present in the Template but i unable to find the Requested For name since the email template is written on Approval table.

Can anyone please help me out how to populate the RITM table field on Approval table ?

1 ACCEPTED SOLUTION

Rajesh feedbacks were helpful but you will still need to query the req_item table;



Please try this just for the fun somewhere on your code



<mail_script>


var ritm = new GlideRecord('sc_req_item');


if(ritm.get(current.sysapproval)){


var req_for = ritm.u_req_for.name;


template.print("Requested for :"+ritm.request.requested_for.name);


template.print("Requested by :"+ritm.u_req_for.name);


}


</mail_script>


View solution in original post

27 REPLIES 27

yes, Customized fields are also available to add.




Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

But i unable to find the customized field, what might be an issue ?


Sorry, i forgotten i think requested_for is not selected in your requested item.



make sure requested for is not emty.



Quickly follow my steps :



1. create new RITM and select requested for and copy This item Number


2. go back to your notification then click on Preview notification, After that replace Request item number which is created by you.


3. check it, definetly it will be populate




Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

Rajesh,



I am glad you understand my query,



Can you please elaborate the last 3 steps:



I created a RITM and copied that RITM number, later went to the notification i.e Approver Request and click on Preview notification button which is present at the bottom then i see the Request by name is available but Request for is empty:



find_real_file.png


Step 1 : create new Requested Item and select requested forfind_real_file.png



step 2 :


got o your notification and follow my screen shot :



find_real_file.png


now you can see in the notification Requested item numbers are same.


finally, requested for is populated   in my case.




Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke