# Need a little help with formatting an action for potentially empty field

**URL:** <https://community.mp3tag.de/t/need-a-little-help-with-formatting-an-action-for-potentially-empty-field/61803>\
**Category:** Support\
**Created:** [August 12, 2023, 4:39pm UTC](https://community.mp3tag.de/t/need-a-little-help-with-formatting-an-action-for-potentially-empty-field/61803 "2023-08-12T16:39:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DoomDitz](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/e5b9ba/32.png) [@DoomDitz](https://community.mp3tag.de/u/DoomDitz)\
**Post date:** [August 12, 2023, 4:39pm UTC](https://community.mp3tag.de/t/need-a-little-help-with-formatting-an-action-for-potentially-empty-field/61803/1 "2023-08-12T16:39:30Z")

</div>

Hi all,

First of all I'm sorry if this is asked before, I searched but cannot find an answer.

I'm setting up an action to rename filenames in a folder using the "Format value" action and setting \_FILENAME for the field. What I'm trying to achieve:

- Rename filenames that have a value for [discnumber] and [track] to [%discnumber%-%track. %artist% - %title%]
- When there's no value for [%discnumber%], I would like it to be excluded from the new string, _including_ the dash between [%discnumber%] and [%track%]!
- Also, i would like no leading zeroes

So the filename of the first track in a batch of files looks like this:

- With [%discnumber%]: [1-1. Cool Band - Nice Song]
- Without [%discnumber%]: [1. Cool Band - Nice Song]

Thanks in advance!  
Tim

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [August 12, 2023, 5:35pm UTC](https://community.mp3tag.de/t/need-a-little-help-with-formatting-an-action-for-potentially-empty-field/61803/2 "2023-08-12T17:35:13Z")

</div>

> [@DoomDitz](#):
>
> [%discnumber%-%track. %artist% - %title%]

Do you need the enclosing square brackets?  
otherwise use:  
Format string: `[%discnumber%-]%track. %artist% - %title%`  
or with the brackets:  
Format string: `'['[%discnumber%-]%track. %artist% - %title%']'`

---

<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:30pm UTC](https://community.mp3tag.de/t/need-a-little-help-with-formatting-an-action-for-potentially-empty-field/61803/3 "2026-02-09T12:30:07Z")

</div>


