Can't publish Automation - Undeclared Variables

Hi,

I am attempting to publish an automation I have created but I am met with the following when attempting to:

Any advice?

Hi @mpearson9526

Some of the variables are not initialized with values or not used in any part of the workflow. Or change the scope for these two variables. Check the two variables complete and User. Check in the variables panel and delete it.

The publish the process.

Deleting the variables did nothing but stop the process working. I’ve removed all unused variables. How do I initialize the variables with values?

You have two options to initialise variable

  1. From variable panel - but make sure the scope. Wherever u r using that variable that scope should be handled properly or you can make available for whole flow.
  2. You can create variable wherever required in the particular activity using ctrl +k

User variable is in scope and there is no “Completed” variable in the panel. This is so confusing. I’ve published this sequence before and not got this error

@mpearson9526,

Try restarting the Studio and System also if required. Sometimes these variables or data gets corrupted in temporary memory which may result in this irrelevant error.

Thanks,
Ashok :slight_smile:

Goto Main flow and select ctrl+f. Search for the variable. If not available close completely and reopen it

Double click the errors and it’ll take you to the activities generating the error, and then you can resolve the fact that they have a red icon on them because the variable isn’t declared.

Tried double clicking errors and just got message details

Tried restarting/reclosing, nothing is working. When I debug the automation works

I’ve ried restarting etc. but nothing is working. When I debug the automation works

Find the activities with the red icons on them. Use universal search to find where those variables are used and then create or rescope the variables.