# Configuration.VersionFormatString

**URL:** https://www.finalbuilder.com/forums/t/configuration-versionformatstring/6294
**Category:** Feature Requests
**Created:** [November 7, 2018, 8:03am UTC](https://www.finalbuilder.com/forums/t/configuration-versionformatstring/6294 "2018-11-07T08:03:39Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![sa\_thomaslohrum](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/ecd19e/32.png) [@sa\_thomaslohrum](https://www.finalbuilder.com/forums/u/sa_thomaslohrum)
#### Post date: [November 7, 2018, 8:03am UTC](https://www.finalbuilder.com/forums/t/configuration-versionformatstring/6294/1 "2018-11-07T08:03:39Z")

</div>

Hi,

as discussed here [$Build.Version$](https://www.finalbuilder.com/forums/t/build-version/6278) i propose to add a configuration variable:

$Configuration.VersionFormatString$

Simply providing the value of what’s there already will satisfy the request as dicussed in the above link. I will then be able to use the value in a tag repository event.

Thomas

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [November 7, 2018, 10:46pm UTC](https://www.finalbuilder.com/forums/t/configuration-versionformatstring/6294/2 "2018-11-07T22:46:07Z")

</div>

Hi Thomas,

Can you give more details on how you will use this? The current Version Format String allows expressions. By default this is `1.0.0.$Build.BuildNumber$`. We’re not sure how this unexpanded expression will be useful. Are you planning to expand it yourself?

---

<div class="post-metadata">

### Author: ![sa\_thomaslohrum](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/ecd19e/32.png) [@sa\_thomaslohrum](https://www.finalbuilder.com/forums/u/sa_thomaslohrum)
#### Post date: [November 8, 2018, 6:58am UTC](https://www.finalbuilder.com/forums/t/configuration-versionformatstring/6294/3 "2018-11-08T06:58:40Z")

</div>

Hi Dave,

specifically i want to use it for:

“Build Event Handler” / “Tag Repository Changeset” / “Tag Name”

The field supports expressions already.

Thomas

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [November 8, 2018, 7:16am UTC](https://www.finalbuilder.com/forums/t/configuration-versionformatstring/6294/4 "2018-11-08T07:16:39Z")

</div>

Sorry, but I still don’t get why you would want to use the Version Format String rather than $Build.Version$? $Build.Version$ is just Version Format String expanded.

---

<div class="post-metadata">

### Author: ![sa\_thomaslohrum](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/ecd19e/32.png) [@sa\_thomaslohrum](https://www.finalbuilder.com/forums/u/sa_thomaslohrum)
#### Post date: [November 8, 2018, 7:17am UTC](https://www.finalbuilder.com/forums/t/configuration-versionformatstring/6294/5 "2018-11-08T07:17:56Z")

</div>

As written in the other post, our FinalBuilder-Script does manipulate CI’s Version by an “Set CI Version” action. For that reason the original value is no longer available.

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [November 8, 2018, 7:25am UTC](https://www.finalbuilder.com/forums/t/configuration-versionformatstring/6294/6 "2018-11-08T07:25:57Z")

</div>

OK, so why not just use a Set Variable action to store the build version a the start of the build. Adding an expression $Configuration.VersionFormatString$ would not work as its value would not be expanded when used.

---

<div class="post-metadata">

### Author: ![sa\_thomaslohrum](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/ecd19e/32.png) [@sa\_thomaslohrum](https://www.finalbuilder.com/forums/u/sa_thomaslohrum)
#### Post date: [November 8, 2018, 7:28am UTC](https://www.finalbuilder.com/forums/t/configuration-versionformatstring/6294/7 "2018-11-08T07:28:17Z")

</div>

> [@Sparky](#):
>
> Adding an expression $Configuration.VersionFormatString$ would not work as its value would not be expanded when used.

Why is that? The “Tag Name” field does support expanding expressions.

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [November 8, 2018, 7:30am UTC](https://www.finalbuilder.com/forums/t/configuration-versionformatstring/6294/8 "2018-11-08T07:30:00Z")

</div>

`$Configuration.VersionFormatString$` would expand to `1.0.0.$Build.BuildNumber$`

---

<div class="post-metadata">

### Author: ![sa\_thomaslohrum](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/ecd19e/32.png) [@sa\_thomaslohrum](https://www.finalbuilder.com/forums/u/sa_thomaslohrum)
#### Post date: [November 8, 2018, 7:35am UTC](https://www.finalbuilder.com/forums/t/configuration-versionformatstring/6294/9 "2018-11-08T07:35:33Z")

</div>

Ok, i got it.

Is there any other way to retrieve the original value that got expanded at the beginning of the build.

For example:

- Version Format String: 1.0.0.$Build.Buildnumber$ gets expanded to 1.0.0.35 by Continua
- FinalBuilder will update CI’s version to “1.0 Build 35”

After executing the Finalbuilder script how can i retrieve the value of “1.0.0.35”?

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [November 8, 2018, 7:41am UTC](https://www.finalbuilder.com/forums/t/configuration-versionformatstring/6294/10 "2018-11-08T07:41:30Z")

</div>

Add a variable called `OriginalBuildVersion` for example. Add a `Set Variable` action before the `FinalBuilder` action, select `OriginalBuildVersion` for the Variable and enter $Build.Version$ as the New Value. Tick the `Expand variable references in new value` checkbox.

Use `%OriginalBuildVersion%` in your `Tag Repository Changeset` build event handler

---

<div class="post-metadata">

### Author: ![sa\_thomaslohrum](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/ecd19e/32.png) [@sa\_thomaslohrum](https://www.finalbuilder.com/forums/u/sa_thomaslohrum)
#### Post date: [November 8, 2018, 7:47am UTC](https://www.finalbuilder.com/forums/t/configuration-versionformatstring/6294/11 "2018-11-08T07:47:02Z")

</div>

That’s what i use for several configurations already. I was out for a solution that would remove the need to create and assign the variable. It’s not a big deal, but requires extra steps for each configuration that we’re using.

Nevertheless, thank you. I’ll stick with that.

Thomas
