If Condition in servicenow Workflow

Shanthi3
Tera Contributor

Hello all,

 

I am trying to create an if condition for the Record producer in workflow. The table and record producer has a checkbox field, when the record is modifying the field from true to false , false to true the approval or event activity should work. But always the value return to 'no' only.

 

Please suggest me how to achieve this functionality.

 

Thanks in Advance.

 

1 REPLY 1

Harish Bainsla
Kilo Patron
Kilo Patron

To achieve this functionality, you can follow these steps:

  1. Create a Workflow:

    • Open the ServiceNow Workflow Editor.
    • Create a new workflow or open an existing one.
  2. Add a Trigger:

    • Drag and drop a "When record is updated" trigger onto the workflow canvas.
    • Configure the trigger to apply to the relevant table and set the condition for your checkbox field. For example, if your checkbox field is named "approval_required", the condition could be: approval_required=true^approval_required!=approval_required.
  3. Add a Decision Step:

    • Drag and drop a "Decision" activity onto the canvas.
    • Configure the decision to evaluate the checkbox field's value. If the checkbox field changes from true to false, or from false to true, the decision should proceed.
  4. Add Approval and Event Activities:

    • If the decision evaluates to true, add an "Approval" activity. Configure the approval process according to your requirements.
    • If the decision evaluates to true, you can also add an "Event" activity to trigger specific events or actions.
  5. Configure Activity Conditions:

    • In the approval and event activities, you can further set conditions to control when they should be executed. For example, you can conditionally execute the activities based on the current value of the checkbox field.
  6. Publish the Workflow:

    • After setting up the workflow, make sure to save and publish it so that it's active and ready to respond to changes.