Skip to main content
Navigator | Tier 3
August 12, 2026
Question

How to Handle Empty ServiceNow Fields

  • August 12, 2026
  • 6 replies
  • 21 views

I’m trying to build a bot to retrieve ServiceNow case information, including Case Number, Assigned, and Created Date.

I’m running into an issue when one of the fields is empty. For example, if the Assigned field has no value in servicenow, the bot gets stuck on that Recorder Capture step and failed

Is there a way to have the bot continue processing the field when the value/property is empty and continue with the capture?


Note: we not allow to use Servicenow API for this task

 

 

 

    6 replies

    Aaron.Gleason
    Automation Anywhere Team
    Automation Anywhere Team
    August 12, 2026

    @Using an Error handler: Try (with no Catch) with the Recorder: Capture inside will try and extract data. If it fails, it just moves on, leaving the previous variable value alone (blank?). 

    DanC25Author
    Navigator | Tier 3
    August 12, 2026

    still same issue and it won’t contiune

    Aaron.Gleason
    Automation Anywhere Team
    Automation Anywhere Team
    August 12, 2026

    @DanC25 You can remove the Catch action. Each Recorder: Capture that could fail needs a Try action around it. If the Recorder: Capture fails, the Try prevents the error and moves onto the next action. 

    Try

        Capture

    Try

        Capture

    etc.

    Another way around it is to have an If action that checks to see if the object exists before using Capture, but that's even wordier. 

    DanC25Author
    Navigator | Tier 3
    August 12, 2026

     

    @Aaron.Gleason  thanks


    It works with the Try block without catch, but if the field is empty, it uses the value from the last successful run.

    How can I set it to something like “Unassigned” instead of previous successful value?

    Aaron.Gleason
    Automation Anywhere Team
    Automation Anywhere Team
    August 12, 2026

     

    @Aaron.Gleason  thanks


    It works with the Try block without catch, but if the field is empty, it uses the value from the last successful run.

    How can I set it to something like “Unassigned” instead of previous successful value?

    @DanC25 In that case, put the Catch back and, inside the Catch, add a String: Assign to the variable you want with the word "Unassigned" there.