cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to find and remove unused variables?


As I go through the development process in my workflows,I am finding myself with a large number of variables which may or may not be used. I have tried deleting variables I thought were unused, relying on the "variable is in use" detection which occurs when doing a delete. Unfortunately, the built in "is in use" detector does not work in every case.The result is a variety of broken workflow actions which of course makes sense; the required variables are now gone.

 

Is there a way to "delete unused variables" that truly tests that the variable is not in use within the workflow?

Labels: (1)
0 Kudos
Reply
8 Replies
Workflow Hero

Re: How to find and remove unused variables?

Unfortunately there is no 1-click solution. Best way to do this is to open up the variable screen and just try and delete one after another. If a variable is being used, the designer will through an error, highlighting which actions use that particular variable.

0 Kudos
Accept as Solution Reply
Not applicable

Re: How to find and remove unused variables?

The problem with “Delete them all then find the dead actions” is that the actions in turn lose whatever configurations they had.

Argh. I suspect the real answer is what you said; there is no way to do this.

Alan McCollough - Lead Web Programmer – ANTHC - Tel: 907-729-2633

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: How to find and remove unused variables?

Sorry, probably wasn't clear Smiley Happy if you try and delete a variable that is used in an action, the designer will not allow for the variable to be deleted. If the variable is not used, it will be deleted without any issues Smiley Happy hope that makes sense. No configuration on any action will be impacted.

0 Kudos
Accept as Solution Reply
Not applicable

Re: How to find and remove unused variables?

That process is the part that is not 100% accurate. I did indeed rely upon the designer to indicate if a variable was in use or not, and it missed a few. The result was a busted workflow because of course the variables were not there, so the affected actions behaved like new actions dragged onto the workflow.

Alan McCollough - Lead Web Programmer – ANTHC - Tel: 907-729-2633

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: How to find and remove unused variables?

That sounds strange, as the designer should not allow you to remove any variables that are being used in action. If that is the case for you, can you please log a support ticket, so we can evaluate and fix it in a subsequent release if it turns out to be a bug?

0 Kudos
Accept as Solution Reply
Not applicable

Re: How to find and remove unused variables?

I'll have to see if this happens in a future workflow, as I've already corrected the one which brought about this inquiry.

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: How to find and remove unused variables?

Hi Alan and Patrick,

I have the same problem as Alan. The designer doesn't throw out errors if the variable is used in task actions, e.g. flexi task, request data actions. So I only add variables as I use them, that way I don't have to check back to see which ones are not in use.

P.S I'm on Nintex Workflow 2010 version 2.4.1.0. Maybe this is fixed in 2013.

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: How to find and remove unused variables?

Hello Alan McCollough and June Cui,

I've created a feature request on UserVoice: Find and remove unused variables – Customer Feedback for Nintex

You might want to give your votes for it... ;-)

0 Kudos
Accept as Solution Reply