fields not visible while dot walking

JagjeetSingh
Kilo Sage
Kilo Sage

hi,

I am creating a flow on Approval table. I see that i am not able to access few fields on Requested item table.

For example- item, Requested for field.

These fields are present on my form but i can access them while dot walking from approval table. These are just not visible there.

Same is happening when i am trying to create notification on approval table.

Any idea what is wrong here.

Jagjeet Singh
ServiceNow Community Rising Star 2022/2023
11 REPLIES 11

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

which action you are using? please share image

Requested for field is not on RITM; it is present on Request table so you need to dot walk on Request field to get Requested for

Regards
Ankur

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

Jaspal Singh
Mega Patron
Mega Patron

Hi Jagjeet,

 

It is an expected behavior as Approval table does not extend Task table & thus having a restriction to directly access the required details of Task table.

For the Flow issue can you share a screenshot for further check.

For Notification you need to use below.

In case you will you need to have a mail script created from System Notification >> Email >> Notification mail script & use below in the script.

(function runMailScript(current, template, email, email_action, event) {

    // Add your code here
//For RITM
    if (current.sysapproval.sys_class_name == 'sc_req_item') {
        var getritm = new GlideRecord('sc_req_item');
        getritm.addQuery('sys_id', current.sysapproval);
        getritm.query();
        while (getritm.next()) {
            template.print('RITM requested for ' + getritm.request.requested_for.getDisplayValue());
        }
    } 
//For Change
else if (current.sysapproval.sys_class_name == 'change_request') {
        var getchng = new GlideRecord('change_request');
        getchng.addQuery('sys_id', current.sysapproval);
        getchng.query();
        while (getchng.next()) {
            template.print('Change Opened for ' + getchng.opened_for.getDisplayValue());
        }
    }


})(current, template, email, email_action, event);

 

Then call the mail script in notification body in format

${mail_script:replaceyourmailscriptnamehere}

 

Thanks Jaspal.

I just thought to use another way here.

My purpose is to send a notification to requester when request is auto rejected.(using flow for this)

I now added a new option in state field with label as 'Auto rejected' keeping the value as rejected so that any running flow doesn't get impacted. I can use this value to trigger the notification.

Now what i see is that the rejected value is not visible in drop down. Any solution for this?

find_real_file.png

Jagjeet Singh
ServiceNow Community Rising Star 2022/2023

Hi,

as per the screenshot the label 'Auto Rejected' can be seen

Regards
Ankur

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