Is wf_activity reference safe to use?

Uncle Rob
Kilo Patron

So I know that wf_activity on task and sys_approval tables will refer back to the activity that triggered the record.   I also notice that the column is inactive by default.

Is this to keep initiates safe, or is the field functionality being deprecated?

I'd like to know because I plan on building reports and metrics around the activity name of of a task / approval vs its Short Description or assignment group.

1 ACCEPTED SOLUTION

Mark Stanger
Giga Sage

I always activate this field as part of a deployment, and have done so for several years.   It's been inactive since it was created as far as I know.   I've never seen any issue with using it and have never heard of it being deprecated in the future.



I like to use it to supply more information on task records about the specific approval step happening.   When you look at a list of approvers on a change for example, you can dot-walk through the 'wf_activity' field and show the name of the approval activity there so people know what each approval is for.



If you're going to use it, I strongly suggest making it read only if it isn't already just so that it doesn't get changed and break the associated workflow.   I'd also recommend you avoid showing the direct link to the workflow activity whenever possible so that people don't accidentally click it and end up at that record wondering what it is.


View solution in original post

10 REPLIES 10

The only time I've seen that field blank when a workflow was attached was when the approval or task record associated was created manually rather than by the workflow.


Branden
ServiceNow Employee
ServiceNow Employee

You unknownling clarified something I've been unclear about for quite some time...



IN other news I apparently don't read the WIKI properly.



Thanks Mark!


I've just run into this because we are making a change to the Approval Activities.   If Opened By = Requested For's Manager, create an Approval Record and set it to Approved.   I've used the initialize() and insert() functions to take care of this.  



Do you see any issues with creating a wf_activity manually?   Is it possible to connect a wf_activity to a manually created Approval Record?


I doubt that would work like you want, and actually incorporate that approval seamlessly into the parent workflow.   You'll have much better luck by creating that approval and then following it immediately after by a Manual approval activity.   You could also potentially script the approval activity so that it created the correct approval there only if the right conditions were met.


I appreciate the info.   For some reason, things just aren't working out for me on this today.   Maybe after the long weekend things will get better.