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

no, if you are field is customized field then no need to specify request.u_req_for



Just specify like below



Requested for: ${u_req_for}




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

Rajesh,



i tried below Requested for: ${u_req_for} but it is not working, when i preview the notificaiton it is displaying just like below:





Requested for:



Previously there is already a Template running on it and if i write Requested for: ${u_req_for}   in HTML message box that template is not working



And beside html message   / template we have an option like fields right ? there my customized field is not visible can you tell me what should be reason ?



find_real_file.png


please click on + icon and select the field




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

I have never ever used the HTML.


Check this screenshot. It works for me



Issue 1:


You must use the template message not message HTML


find_real_file.png



Issue 2:


Make sure you template is using the plaintext (there's a link at the bottom saying 'revert to plaintext editor')




Then you can create a notification using your template



find_real_file.png


Rajesh,



I already selected but i unable to find the field there,, thats what i was trying to tell you.



Will customized fields wont be available there ?