Compose Client Email Template functionality

Pooja Limbani
Giga Guru

Hi All,

I am trying to configure the 'Email Client Template', in which, under 'Sender Configuration' tab, by setting From Generation Type, as script & Here in Email, I am trying to set the 'From' field , a value of a current record field(u_email_id). Is there any way to do that instead of getting value from Table 'Email Client From Address' (sys_email_client_from_address_list.do).

PoojaLimbani_0-1748609862222.png

 

Here, in the below image, it calls below function, 
(function (fromAddressQuery, targetRecord) {
})(fromAddressQuery, targetRecord);

PoojaLimbani_1-1748610047276.png

Please assist to achieve this without calling Email Client From Address

 

 

If this response resolved your issue, kindly mark it as Helpful or Accept Solution—it helps others find the answer faster.
1 ACCEPTED SOLUTION

Hi @Ankur Bawiskar 

Thank you so much for your support
I actually found a way to populate it by using below:


From Generation Type : Text

PoojaLimbani_0-1748622101876.png

 

 

 

This worked in my scenario.


If this response resolved your issue, kindly mark it as Helpful or Accept Solution—it helps others find the answer faster.

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@Pooja Limbani 

did you try accessing current object in that script?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur, Thank you for your response.
I did try with current object, but no luck on same.


If this response resolved your issue, kindly mark it as Helpful or Accept Solution—it helps others find the answer faster.

@Pooja Limbani 

the targetRecord is the object which holds the current, so try that once

(function (fromAddressQuery, targetRecord) {
        /**
         * fromAddressQuery: A GlideRecord on the table "sys_email_client_from_address". Add conditions to filter the
         *      the email addresses displayed in the Email Client.
         * targetRecord: A GlideRecord representing the record in which the Email Client was opened from
         */

        return targetRecord.u_email_id.toString();

})(fromAddressQuery, targetRecord);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@Pooja Limbani 

try this in the script field

(function (fromAddressQuery, targetRecord) {
        /**
         * fromAddressQuery: A GlideRecord on the table "sys_email_client_from_address". Add conditions to filter the
         *      the email addresses displayed in the Email Client.
         * targetRecord: A GlideRecord representing the record in which the Email Client was opened from
         */

        return targetRecord.u_email_id.toString();

})(fromAddressQuery, targetRecord);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader