# Script to expand value in variable?

**URL:** https://www.finalbuilder.com/forums/t/script-to-expand-value-in-variable/1342
**Category:** Discussion
**Created:** [October 14, 2009, 9:00am UTC](https://www.finalbuilder.com/forums/t/script-to-expand-value-in-variable/1342 "2009-10-14T09:00:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nelsonwolf](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/b9e5f3/32.png) [@nelsonwolf](https://www.finalbuilder.com/forums/u/nelsonwolf)
#### Post date: [October 14, 2009, 9:00am UTC](https://www.finalbuilder.com/forums/t/script-to-expand-value-in-variable/1342/1 "2009-10-14T09:00:13Z")

</div>

Is there a function in the script action I can call to expand variables in a variable?

IE if MyVar = %OtherVar%, is there a function I can call that will force MyVar to be equal to the value of %OtherVar% ? &nbsp;

I am able to use a Set Variable action to set MyVar to %MyVar%, but I was wondering if there is a function I could use instead.

Thanks!

-Nelson

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [October 14, 2009, 10:32am UTC](https://www.finalbuilder.com/forums/t/script-to-expand-value-in-variable/1342/2 "2009-10-14T10:32:05Z")

</div>

Hi Nelson,   
  
 You can use the following script:   
  
 MyVar = Action.ExpandExpression("%MyVar%");   
  
 Regards,   
 Paul.

---

<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: [October 14, 2009, 10:45am UTC](https://www.finalbuilder.com/forums/t/script-to-expand-value-in-variable/1342/3 "2009-10-14T10:45:26Z")

</div>

OR :   
  
 MyVar = Action.ExpandExpression("%OtherVar%");
