Can't find custom field from business rule/flow

Abbottronix
Tera Guru

I'm trying to create either a business rule or flow that is triggered when an approval record is created for a change record, and a custom field on the change record has a certain value. I've created the custom field called "Approval State" on the change request form, but when I go to create a business rule or flow on the approval table, and then drill down to "Approval for" I can't find my custom field. 

 

Screenshot 2024-11-26 172233.png

1 ACCEPTED SOLUTION

Tai Vu
Kilo Patron
Kilo Patron

Hey @Abbottronix 

The Approval field on the [sysapproval] table is a reference to the Task [task] table, while your custom field was created on the Change Request [change_request] table.

So just to one more step dot-walk to the Change Request table, where you will find your custom field. Like below.

Timi_0-1732603926655.png

 

 

Cheers,

Tai Vu

View solution in original post

3 REPLIES 3

Tai Vu
Kilo Patron
Kilo Patron

Hey @Abbottronix 

The Approval field on the [sysapproval] table is a reference to the Task [task] table, while your custom field was created on the Change Request [change_request] table.

So just to one more step dot-walk to the Change Request table, where you will find your custom field. Like below.

Timi_0-1732603926655.png

 

 

Cheers,

Tai Vu

Thank you! I couldn't find Change Request in the drop down but it appeared when I typed it in the search box like in your screenshot.

Juhi Poddar
Kilo Patron

Hello @Abbottronix 

 

Since the custom field is on change record, it will not be available in Approval table. 

Here is how you can achieve the requirement:

Write a Business Rule on sysapproval_approver:

  • Create a Business Rule on the sysapproval_approver table.
  • Checkbox advanced
  • Use the following script to check for the Approval State field on the related Change record.

 

if (current.source_table == 'change_request') {
    var grChange = new GlideRecord('change_request');
    if (grChange.get(current.document_id)) {
        if (grChange.approval_state == 'desired_value') {
            // Perform your logic here
        }
    }
}

 

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps others find the solution more easily and supports the community!"

 

Thank You
Juhi Poddar