Matrix of data places in a Script include

ServNowDev
Tera Guru

Not sure if this a good place to post this , but just looking for a design standpoint, I have a script include that is going to accept three values of data , the user type , created date, and department, each function will get the each piece of data

user typedata createddepartment
Platinum2001help desk
Platinum2012help desk
Platinum2012help desk
Platinum2012help desk
Gold2001hr
Gold2001hr
Gold2000hr

 

one scenarios could be if the user type is gold, and date is before 2012 and dept is hr then output a value, there are about 20 permatations depending on these scenarios, from a design is there a better way of doing this without a bunch of if loops?

1 REPLY 1

Sumanth16
Kilo Patron

Hi @ServNowDev ,

 

You need to pass data like array in the script includes by passing as json object.

 

Please refer to below thread:

https://www.servicenow.com/community/itsm-forum/how-to-pass-array-of-objects-from-script-include-to-...

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda