Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Catalog item check IP ranges

MonicaW
Tera Guru

I need to write a catalog item flow that will check for three separate IP ranges on a single variable.  If the IP that is entered is outside those ranges, then I need a group approval to be created.

Any ideas would be appreciated.

Thank you,

Monica W.

1 ACCEPTED SOLUTION

Hi @MonicaW ,

For basic understanding i will add the sreen grab of my PDI flow and DT.
if still facing issue you can have a look at the Document i have attached named 'Catalog item check IP ranges' it has a detailed overview of what i have done in my PDI like Flow designDecision Table, RITM raised for IP address within the range(those 3 IP Adress) and Out of range.

 

RavindraHV_0-1763111211364.png

RavindraHV_1-1763111227365.png

 

Please Mark 👍Helpful if you find my response worthy based on the impact.
Thank You,
Ravindra H V

View solution in original post

12 REPLIES 12

SAI VENKATESH
Kilo Patron
Kilo Patron

Hi @MonicaW 

 

What you can do is take the values you’re getting from that single variable and convert them into an array using the split function (split by a comma). Then, use a loop in Flow Designer to check whether a particular value is available or not.

thanks and Regards

Sai Venkatesh

Ravindra H V
Tera Expert

Hi @MonicaW ,

  1. Create the Catalog Item Variable

    • Type: IP Address 

    • Name: requested_ip

  2. Create a Flow for the Catalog Item

    • Go to Flow DesignerNew Flow

  3. Add a Flow Variable step

    • Input: requested_ip from the Catalog Item.

    • This will store the IP address for use in the flow.

  4. Create a Decision Table
  • Navigate to Process Automation → Decision Tables

  • Click New Decision Table


-> Decision Table Setup

Condition Name Operator Value Outcome
IP in Range 1is in IP range 10.0.0.0 – 10.8.255.255Approved
IP in Range 2is in IP range172.16.0.0 – 172.15.255.255Approved
IP in Range 3is in IP range192.168.1.0 – 192.158.1.255Approved
Default—(for values other than these 3 values)—(for values other than these 3 values)Needs Approval


       6.  Call Decision Outcomes in your flow :

  • If Outcome = Approved → Proceed without approval

  • If Outcome = Needs Approval → Create Approval → Group

    • Assign to: e.g. “Network Approvers” group
      Link - Decision Table


      Mark 👍Helpful if you find my response worthy based on the impact.
      Thank You,
      Ravindra H V



Hi Ravindra:

This looks like a great solution.  I have never worked with decision tables and even after reviewing the video, I'm not sure how to create it.  What goes in the Inputs?  What goes in the Conditions/Results section (would this be the table you provided as an example)?

Thank you for any additional help.

Hay @MonicaW ,

yes, the table i mentioned refers to the Decision table input and Output.
column 1 - Ip Range is 10.0.0.0 – 10.8.255.255(i/p)
column 2 - Result is Approved(o/p)

IP in Range Result
10.0.0.0 – 10.8.255.255Approved
172.16.0.0 – 172.15.255.255Approved
192.168.1.0 – 192.158.1.255Approved
—(for values other than these 3 values)Needs Approval



Please refer this Youtube link to understand the linking b/w DT and Flow - LINK

if you still have some diificulties in building the logic i can try in my PDI and display the results.

Please Mark 👍 
Helpful if you find my response worthy based on the impact.
Thank You,
Ravindra H V