# A code for action for an empty field

**URL:** <https://community.mp3tag.de/t/a-code-for-action-for-an-empty-field/19264>\
**Category:** Support\
**Created:** [August 24, 2017, 11:46am UTC](https://community.mp3tag.de/t/a-code-for-action-for-an-empty-field/19264 "2017-08-24T11:46:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)\
**Post date:** [August 24, 2017, 11:46am UTC](https://community.mp3tag.de/t/a-code-for-action-for-an-empty-field/19264/1 "2017-08-24T11:46:42Z")

</div>

What would be a code for an action to put something in a tag field if it is empty? Let's say a single dot?

It should only be executed [putting the dot sign] when there is nothing in a given field or if it has only white spaces and nothing more

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [August 24, 2017, 12:04pm UTC](https://community.mp3tag.de/t/a-code-for-action-for-an-empty-field/19264/2 "2017-08-24T12:04:42Z")

</div>

**$regexp(%yourfieldhere%,^$,.)**

That's the regexp way.

Give yourself a little task and learn and see if you can manage to do it with the $ifgreater(a,b,x,y) and %len() functions.

[https://docs.mp3tag.de/scripting](https://docs.mp3tag.de/scripting)

---

<div class="post-metadata">

**Author:** ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)\
**Post date:** [August 24, 2017, 12:20pm UTC](https://community.mp3tag.de/t/a-code-for-action-for-an-empty-field/19264/3 "2017-08-24T12:20:36Z")

</div>

> [@Zerow](#):
>
> What would be a code for an action to put something in a tag field if it is empty?

There are no empty tag-fields. If they exist, they are not empty. Otherwise they don't exist.

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [August 24, 2017, 12:24pm UTC](https://community.mp3tag.de/t/a-code-for-action-for-an-empty-field/19264/4 "2017-08-24T12:24:07Z")

</div>

> [@Zerow](#):
>
> What would be a code for an action to put something in a tag field if it is empty? Let's say a single dot? ...

Action "Format value"

**TEST \<== $if(%TEST%,%TEST%,'.')**

DD.20170824.1626.CEST

---

<div class="post-metadata">

**Author:** ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)\
**Post date:** [August 24, 2017, 7:59pm UTC](https://community.mp3tag.de/t/a-code-for-action-for-an-empty-field/19264/5 "2017-08-24T19:59:07Z")

</div>

> [@poster](#):
>
> There are no empty tag-fields. If they exist, they are not empty. Otherwise they don't exist.

Yes

And there are no passive radiators. Every radiator is a passive cooling element. And yet some are made, marketed and sold as passive ones; on the account that they should not require a fan mounted on them

A figure of speech

> [@stevehero](#):
>
> **$regexp(%yourfieldhere%,^$,.)**
> 
> That's the regexp way  
> [...]

Works, thank you

> [@DetlevD](#):
>
> Action "Format value"
> 
> **TEST \<== $if(%TEST%,%TEST%,'.')**

Works, thank you

Although both of those codes the do not take into consideration a case when [unwantedely] only a pause or pauses are present in a given field; but that can be of course managed with a running prior to them a simple action  
$trim(%FIELD-NAME-HERE%)

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [August 24, 2017, 10:00pm UTC](https://community.mp3tag.de/t/a-code-for-action-for-an-empty-field/19264/6 "2017-08-24T22:00:54Z")

</div>

$regexp(%yourfieldhere%,^$,.)

Will be to like to work for fields that may or may not have whiitespaces, would be.

$regexp(%yourfieldhere%,^\s\*$,.)

I think you meant whitespace/s for pauses... ![:huh:](https://community.mp3tag.de/uploads/default/original/1X/f15ee73c0fd9ec3b0db7481f0558638f8ee224ce.gif ":huh:")

---

<div class="post-metadata">

**Author:** ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)\
**Post date:** [August 25, 2017, 2:49am UTC](https://community.mp3tag.de/t/a-code-for-action-for-an-empty-field/19264/7 "2017-08-25T02:49:42Z")

</div>

> [@Zerow](#):
>
> A figure of speech

No. It is not a figure of speech. There is no such tag in the file and therefore it can't be empty.  
The tag-sytems is not a the same as a database with empty entries.

If you have no car you don't say: I have an empty car.

Normal filter-expression in MP3Tag therefore for this case is %tag\_example% MISSING.

---

<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:26pm UTC](https://community.mp3tag.de/t/a-code-for-action-for-an-empty-field/19264/8 "2026-02-09T12:26:58Z")

</div>


