TimeoutMS as Int32 variable not working properly

Hello UiPath,

If you have timeout as an Int32 variable or argument and use it as a property for timeout in any activity then if value is Nothing then it becomes 0 miliseconds. However, when you don’t use the variable, activity uses default value from Project settings which seems to be the same as Nothing. A workaround is to copy the activity in an if-else activity with the variable in use providing that value > 0 in the if and the variabel not in use in the else. Is there a better way of doing this or is this actually a bug?

Why not just set the default value of the variable to the default timeout value? Then it’s never “Nothing”

Because i want to use the default project timeout, not hardcoded default timeous for one particular activity. Is there a way to access this through code?

I didn’t say hardcoded timeouts. I said set the default value of your variable to the same as the default project timeout. Then if you don’t change the value of the timeout somewhere in your code, it’ll just be the same as the default project timeout.

Ok, then please tell me how do you set the variable to the same as the default project timeout without hardcoded it as 30.000 (default project timeout)?

In the variables pane, set the default value for the variable to 30000.

But that would be hardcoding it? I don’t want that. Variable should have same value as project settings if not changed somewhere else in the scope. If i change project settings defaults to 60.000 then as a developer i would have to remember to change the hardcoded value as well

I don’t think there’s a way to get the “current process global timeout” and put it into a variable. I think the best you can achieve is to remember to change it in both places. Another option would be to make it an argument instead of variable (assuming unattended process) - then you could change the timeout by changing the Process Parameters in Orchestrator, without even having to open the Project and republish.

It could be valuable for UiPath to modify how things work so that if the variable in a timeout property is Nothing, then it uses the default rather than 0.