# Set a default Value in a Tag if it's not populated

**URL:** https://community.mp3tag.de/t/set-a-default-value-in-a-tag-if-its-not-populated/11317
**Category:** Support
**Created:** [December 20, 2010, 7:33pm UTC](https://community.mp3tag.de/t/set-a-default-value-in-a-tag-if-its-not-populated/11317 "2010-12-20T19:33:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Windjammer](https://community.mp3tag.de/user_avatar/community.mp3tag.de/windjammer/32/68_2.png) [@Windjammer](https://community.mp3tag.de/u/Windjammer)
#### Post date: [December 20, 2010, 7:33pm UTC](https://community.mp3tag.de/t/set-a-default-value-in-a-tag-if-its-not-populated/11317/1 "2010-12-20T19:33:52Z")

</div>

Hi Forum,

I'm writing the DISCNUMBER and TOTALDISCS tags that are used in iTunes among others. I'm using Pufas DiscOgs script to import them. Not all pages on DiscOgs have these tags and for those I need an Action that if the DISCNUMBER and TOTALDISCS tags are empty puts 1 in both as the default value. I have not found any RegEx that does that, but then again I'm really not very good at it.

Thanks and Regards.

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [December 20, 2010, 8:53pm UTC](https://community.mp3tag.de/t/set-a-default-value-in-a-tag-if-its-not-populated/11317/2 "2010-12-20T20:53:22Z")

</div>

_Action type:_ **Format value**  
_Field:_ **DISCNUMBER**  
_Format string:_ **$if2(%discnumber%,1)**

---

<div class="post-metadata">

### Author: ![Windjammer](https://community.mp3tag.de/user_avatar/community.mp3tag.de/windjammer/32/68_2.png) [@Windjammer](https://community.mp3tag.de/u/Windjammer)
#### Post date: [December 22, 2010, 6:28pm UTC](https://community.mp3tag.de/t/set-a-default-value-in-a-tag-if-its-not-populated/11317/3 "2010-12-22T18:28:50Z")

</div>

Thanks! 😃

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:22pm UTC](https://community.mp3tag.de/t/set-a-default-value-in-a-tag-if-its-not-populated/11317/4 "2026-02-09T12:22:45Z")

</div>


