The CreatorCon Call for Content is officially open! Get started here.

Searching for a value in a workflow's run script or if script activity

Nisar2
Mega Guru

Hi experts,

I'm trying to find a way to search for a string inside the workflow activities that have a provision to enter scripts (such as run script or if script). The closest I got to was this thread -> https://community.servicenow.com/community?id=community_question&sys_id=4cd0d3a9dbdcdbc01dcaf3231f96...

However, whenever I try to open sys_variable_value table, it times out (probably due to huge volume of data). I also tried sys_variable_value.FILTER and then adding a "Created on Last Minute" filter and still it was timing out.

Thus was wondering if there was a way around this or perhaps an alternate way to searching?

4 REPLIES 4

Brad Bowman
Kilo Patron
Kilo Patron

FetchCode will find values inside of workflow scripts (and almost everywhere else).

https://developer.servicenow.com/connect.do#!/share/contents/1176688_fetchcode_an_instance_code_sear...

It's free, on the Share site, and easy to download and install (import an update set).

Thanks. That looks dope.

However, if I check the code, it's basically gliding the sys_variable_value table for activity definitions - something that I too was attempting to do and faced timeouts. How would this ensure that while searching it doesn't get timed out?

I don't know if the installation changes any of the timeout durations, but it's likely bypassing it.  When working with a long-running script I recall seeing something about a way to run a script that doesn't use the system duration, so it's like it's trusted, or runs in the background or something so that it can run longer without impact. 

Nisar3
Giga Guru

Hi folks,

 

Apart from Brad's suggestion, is there any other way to achieve it?