# Control NT service action errors when variable is defined in the action group

**URL:** https://www.finalbuilder.com/forums/t/control-nt-service-action-errors-when-variable-is-defined-in-the-action-group/3398
**Category:** Bugs
**Created:** [September 23, 2011, 7:42am UTC](https://www.finalbuilder.com/forums/t/control-nt-service-action-errors-when-variable-is-defined-in-the-action-group/3398 "2011-09-23T07:42:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![j4s0n](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@j4s0n](https://www.finalbuilder.com/forums/u/j4s0n)
#### Post date: [September 23, 2011, 7:42am UTC](https://www.finalbuilder.com/forums/t/control-nt-service-action-errors-when-variable-is-defined-in-the-action-group/3398/1 "2011-09-23T07:42:44Z")

</div>

&nbsp;I'm using the 'control NT service' action to get the state of a service on a remote server and store it in a local variable (var is defined in my action group)

the log outputs:

Getting state Services Name  
Service in state: Stopped  
Variable : svcTest - is not defined!  
Variable not defined

In the property window of the service action i can see and select this variable from the drop down list. If i move the vaiable from the action group to a project level var, it works fine.&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

### Author: ![stephen.ryan](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@stephen.ryan](https://www.finalbuilder.com/forums/u/stephen.ryan)
#### Post date: [September 26, 2011, 1:01am UTC](https://www.finalbuilder.com/forums/t/control-nt-service-action-errors-when-variable-is-defined-in-the-action-group/3398/2 "2011-09-26T01:01:20Z")

</div>

Hi Jason   
  
 This error indicates that the action cannot find the variable specified. Can you please confirm that the ‘Control NT Service’ action is a child action (indented underneath) of the Action Group that you defined your local variable within?   
  
 Regards,   
 Steve

---

<div class="post-metadata">

### Author: ![j4s0n](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@j4s0n](https://www.finalbuilder.com/forums/u/j4s0n)
#### Post date: [November 23, 2011, 4:24am UTC](https://www.finalbuilder.com/forums/t/control-nt-service-action-errors-when-variable-is-defined-in-the-action-group/3398/3 "2011-11-23T04:24:02Z")

</div>

&nbsp;i think i finally tracked down the issue!&nbsp;

I have reproduced this error in a different project with different action types.&nbsp;

if you have an Action group with a local variable defined and have an Async action group inside, any action under the async that trys to use the variable will fail. if i turn off async the same actions work.

this was a pita to track down... i hope you guys can fix it

---

<div class="post-metadata">

### Author: ![stephen.ryan](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@stephen.ryan](https://www.finalbuilder.com/forums/u/stephen.ryan)
#### Post date: [November 23, 2011, 10:43am UTC](https://www.finalbuilder.com/forums/t/control-nt-service-action-errors-when-variable-is-defined-in-the-action-group/3398/4 "2011-11-23T10:43:56Z")

</div>

Hi Jason   
  
 Thanks for additional information. I can reproduce this here, so we will look into it and get back to you.   
  
 Regards,   
 Steve

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [November 24, 2011, 12:32pm UTC](https://www.finalbuilder.com/forums/t/control-nt-service-action-errors-when-variable-is-defined-in-the-action-group/3398/5 "2011-11-24T12:32:47Z")

</div>

This is unfortunately a limitation of how async groups work. Each immediate child action of the async group is actually inserted into a psuedo actionlist and then run in a separate thread with it’s own actionlist runner. The problem there is that it disconnects the child action from the async group, and that means that local variables cannot be resolved up the tree. It may be possible to fix this, however it’s a major change (with potentially serious side effects) and not one I’m prepared to risk in a minor update. I will add an r&d task for the development of the next major version and see what can be done then.
