Include catalog item's properties in Request table notification email

SC10
Kilo Guru

I've created a new 'translated html' field on the Catalog Item form, similar to that of "Description", to add in some more information to my catalog items.

I'd like to use this additional information in the emails that send out when the catalog item's Request (sc_request table) is closed.

Can I dot walk to the properties of my Catalog Item? Can I pull the display value of my new 'translated html' field even? I tried doing a mail script to pull the data of my new "testinfo" field, but it comes back as undefined:

<mail_script>

    var gr = new GlideRecord("sc_req_item");

    gr.addQuery("request", current.sys_id);

    gr.query();

    while(gr.next()) {

    template.print(gr.testinfo.getDisplayValue());

  }

</mail_script>

1 ACCEPTED SOLUTION

Good day,



I was able to get this working after using the following code:



var gr = new GlideRecord("sc_req_item");


    gr.addQuery("request", current.sys_id);


    gr.query();


    while(gr.next()) {


    template.print(gr.cat_item.u_test_info.getDisplayValue());


  }



This works as the email notification is running off of the Request table.



Thank you for everyone's time, especially Venkat who assisted me along with this day after day.


View solution in original post

32 REPLIES 32

I see it on the Requested Item, I added it to the RITM form via dot walking to "Item", and inspecting it it shows up as such:



sc_req_item.cat_item.u_test_info




Here is how it looks on the Requested Item: http://puu.sh/oeTsd/a7ca3c813e.png



Here how it looks on the catalog item itself: http://puu.sh/oeTwm/1f754961c9.png




I am going to try next pulling in a standard string field, instead of Translated HTML. My hunch is that is what is breaking it, but I am not yet sure.


venkatiyer1
Giga Guru

Hi Shane,



I saw your screenshots. Since it is not declared in variables and as a part of catalog item itself. Can you edit the workflow, if there is one to pass on that value to requested item. So in the workflow, you can set the input values for workflow and set it to the current object. You can have a different field name in Requested item and assign the value to it. Alternatively you can create a business rule on before insert to get the value from catalog item. Once you can see the translated html value in requested item you will be able to get the same value in notification.


Good day,



I was able to get this working after using the following code:



var gr = new GlideRecord("sc_req_item");


    gr.addQuery("request", current.sys_id);


    gr.query();


    while(gr.next()) {


    template.print(gr.cat_item.u_test_info.getDisplayValue());


  }



This works as the email notification is running off of the Request table.



Thank you for everyone's time, especially Venkat who assisted me along with this day after day.