# Perforce Sync Action: Unable to use Env Variable for Changelist number

**URL:** https://www.finalbuilder.com/forums/t/perforce-sync-action-unable-to-use-env-variable-for-changelist-number/3056
**Category:** Bugs
**Created:** [December 21, 2008, 11:33am UTC](https://www.finalbuilder.com/forums/t/perforce-sync-action-unable-to-use-env-variable-for-changelist-number/3056 "2008-12-21T11:33:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rafael](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/4da419/32.png) [@rafael](https://www.finalbuilder.com/forums/u/rafael)
#### Post date: [December 21, 2008, 11:33am UTC](https://www.finalbuilder.com/forums/t/perforce-sync-action-unable-to-use-env-variable-for-changelist-number/3056/1 "2008-12-21T11:33:57Z")

</div>

I have a problem…   
  
 When I use an Env var in the P4 sync operation (as shown in the shot below), it is not respected.   
  
 If I enter the changelist # into the action by hand (e.g. set it to 1234) that works OK.   
  
 My desired flow is:   
  
 1) Prompt user for changelist #   
 2) Set an env var: %P4ChangeList%   
 to this entered changelist #   
 3) Then sync to this changelist (I have several sync operations, so this way one prompt feeds all syncs)   
  
  
 But it isn’t working…   
  
 Note, my var is named: %P4ChangeList% (the last several digits are not viewable in the short edit, but they are  
  
 Thanks !!!

 ![finalbc.PNG.jpg](https://www.finalbuilder.com/forums/uploads/default/original/2X/3/36d52efa88c3641eaab4d9c98c38d537f3e48b03.jpeg)

---

<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: [January 3, 2009, 12:05pm UTC](https://www.finalbuilder.com/forums/t/perforce-sync-action-unable-to-use-env-variable-for-changelist-number/3056/2 "2009-01-03T12:05:40Z")

</div>

Hi Sam   
  
 As a work around until this is fixed, in the BeforeAction script event add this (VBScript) :   
  
 Action.ChangeNum = FBVariables.P4ChangeList   
  
 HTH

---

<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: [January 5, 2009, 5:16am UTC](https://www.finalbuilder.com/forums/t/perforce-sync-action-unable-to-use-env-variable-for-changelist-number/3056/3 "2009-01-05T05:16:44Z")

</div>

Hi Sam   
  
 I just had a look at this, the variable is getting expanded just fine. Can you show the log output from this action? Also, this is a depricated action, you should consider migrating this action to the newer perforce actions.
