top of page

Experiencing challenges with ServiceNow support?

Access professional, reliable assistance tailored to your needs—without breaking your budget.

Understanding 'Current' and 'Previous' in ServiceNow Business Rules

Updated: Mar 30

ServiceNow Business Rules are essential server-side scripts that execute during database operations like insertions, updates, deletions, and queries. To effectively manage these operations, ServiceNow developers and administrators must thoroughly understand two important objects: current and previous. These objects allow scripts to access and evaluate a record's old and new states, enabling precise control and decision-making within the ServiceNow platform.


What are current and previous Objects?


The current and previous objects are both GlideRecord objects provided automatically by ServiceNow during Business Rule execution. Here's what they represent:


  • Current Object:

    • Represents the new or updated state of the record during a business rule execution.

    • Contains all updated field values at runtime.

    • Accessible in all synchronous business rules (before, after, insert, update, delete).


  • Example: If an incident's state changes from 'New' to 'In Progress,' current.state will be 'In Progress.'


  • Previous object:

    • Represents the original state of the record prior to the current operation.

    • Only available during record updates and deletes (not insertions or asynchronous rules).


  • Example: If an incident was previously assigned to no one, and now assigned to a user named John, previous.assigned_to will be empty while current.assigned_to will contain John's user ID.


Practical Example in Script:

if (current.state == 'In Progress' && previous.state != 'In Progress') {
    gs.eventQueue('incident.state.changed_to_in_progress', current, previous.state, current.state);
}

Troubleshooting Common Issues:


  • Issue: previous object being null or empty.

    • Cause: Typically happens during insert operations or asynchronous business rules.

    • Resolution: Ensure you're using previous only in contexts where it’s available (updates, synchronous rules).


Alternative Solutions:


  • Use current.changesTo() or similar built-in methods instead of direct comparisons for better readability and fewer errors.

  • Leverage business rule conditions to trigger logic selectively, avoiding unnecessary script execution.


Understanding and properly utilizing the current and previous objects in ServiceNow business rules significantly enhances your capability to implement precise logic. Remember to:


  • Use current for new or updated values.

  • Rely on previous to reference original values, particularly in update scenarios.

  • Avoid using previous in insert or asynchronous contexts to prevent script failures.

  • Prefer built-in GlideRecord methods like changesTo() to simplify and enhance your business rule scripts.


By applying these insights, you'll enhance your ServiceNow implementation's accuracy, maintainability, and efficiency.


Experiencing challenges with ServiceNow support?

Access professional, reliable assistance tailored to your needs—without breaking your budget.

CONTACT

New Zealand HQ

Integrated Knowledge Consulting Office

Level 3, 93 Grafton Road

Auckland

South Korea

Integrated Knowledge Consulting Office

BMY역삼타워 6층

서울특별시 강남구 역삼동 678-10번지

 

info@ikconsulting.com

Thanks for submitting!

  • LinkedIn Social Icon

© Copyright 2025 Integrated Knowledge Consulting. All rights reserved.

bottom of page