Remove Unused Variable

If i click this does it automatically removed all unused variables on my workflow??

1 Like

@Gemlan,

Yes it will remove unused variables of the workflow.

Okay! Brining this topic back up to the top. How do I do this in StudioX?

I looked at all the settings in StudioX CE. I don’t see any way to remove the variable once created.

image

The variable still shows up in the variables list even after the “Save for later” activity has been removed for that variable.

For now, the local Workflow Analyzer rule has been set to Warning . But if the organization policy is set to Error for this rule, how will the StudioX user remove this variable?

Thanks

cc: @AndrewHall

Are you sure there are no other activities that are assigning values to it? These aren’t variables like in Studio, so StudioX is looking at the workflow directly to see if you are assigning/using saved for later values, if there are no activities that interact with a value, you shouldn’t receive the warning and it should disappear from Data Manager.

If you look in the Data Manager do you see that saved for later? If so, double clicking should take you to the activity where it is being interacted with.

Yes, that could another reason. I may have activities that might have been commented out or missed entirely. I will look through the flow. The flow is really long and has multiple spots where this variable was initially used. I may have left a spot or two.

Which begs the question - if someone did write a long flow in StudioX with multiple nesting or switch-case statements (which is definitely possible for a Citizen to accomplish) , and if something changed, how would it impact the ability of the Citizen to maintain this flow? It would be really hard for owners of this flow to maintain it.

It would be really helpful to StudioX users, if they could have some way to click on the Workflow analyzer message and navigate to the spot where that variable or activity is.

Just my thought.

Thanks for the quick turnaround.

Andy Menon

Founder, Lead RPA Architect & Engineer | UiPath MVP 2021

www.rpavanguard.com | 617.671.5599


@rpavanguard fair point about more tightly connecting Workflow Analyzer and the designer, but to my comment/question above. The Data Manager should reflect the same thing you are seeing in the analyzer rule, and if you double click the name of the saved value in Data Manager it will automatically focus the activity that has a property writing to the saved value. So while it’s not present in the warning list, the capability exists through the data manager.

Be careful. I found that the analyzer will report things as unused if you didn’t use an activity from the package, but used a function from the package. For example, install the UiPath.WebAPI package and then in an Assign, use say the deserialize function. Then run analyzer. It’ll think the WebAPI package is unused even though you used one of the functions in the assign. I suspect it only sees the package as used if you use an activity from the package.

I think I wasn’t very clear. To make it more simpler, is there a way that the method of identifying unused variables and locating them could be a StudioX feature?

I agree that WFA must not be tightly coupled with the situation.

Thanks

Just wanted to quickly clarify it the Unused saved for later validation error was coming from opening a StudioX project in Studio.
If so, I don’t believe we could have an equivalent feature in StudioX. The two have a different experience based on how we’re creating them. In Studio, you could create a new Variable in the panel without using it in your Workflow - this allows it not to be present in the Design panel. However, when you’re creating a variable in StudioX, you are doing it through Save for later within an activity. This would count as usage in the design experience as you are indeed having it part of an action. Hope this helps!

This topic was automatically closed after 9 days. New replies are no longer allowed.