# Card Creation Despite Blank Fields

**URL:** <https://forums.ankiweb.net/t/card-creation-despite-blank-fields/4759>\
**Category:** Card Design\
**Created:** [November 1, 2020, 11:01pm UTC](https://forums.ankiweb.net/t/card-creation-despite-blank-fields/4759 "2020-11-01T23:01:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![applesauce](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@applesauce](https://forums.ankiweb.net/u/applesauce)\
**Post date:** [November 1, 2020, 11:01pm UTC](https://forums.ankiweb.net/t/card-creation-despite-blank-fields/4759/1 "2020-11-01T23:01:51Z")

</div>

Having trouble with multiple cards being created despite blank fields… want to have these cards created only if there is text in the fields. See template HTML below:

Front Template:

{{Topic}}  
  

{{Front A}}

Back Template:

{{Topic}}  
  

{{Front A}}

  

{{Front B}}

{{Front C}}

{{Front D}}

{{Front E}}

{{Front F}}

{{Front G}}

{{Front H}}

{{Front I}}

{{Front J}}

{{Front K}}

{{Front L}}

* * *

{{#Back A}}

{{Back A}}
  

{{/Back A}}

{{#Back B}}

{{Back B}}
  

{{/Back B}}

{{#Back C}}

{{Back C}}
  

{{/Back C}}

{{#Back D}}

{{Back D}}
  

{{/Back D}}

{{#Back E}}

{{Back E}}
  

{{/Back E}}

{{#Back F}}

{{Back F}}
  

{{/Back F}}

{{#Back G}}

{{Back G}}
  

{{/Back G}}

{{#Back H}}

{{Back H}}
  

{{/Back H}}

{{#Back I}}

{{Back I}}
  

{{/Back I}}

{{#Back J}}

{{Back J}}
  

{{/Back J}}

{{#Back K}}

{{Back K}}
  

{{/Back K}}

{{#Back L}}

{{Back L}}
  

{{/Back L}}

{{hint:Notes}}

---

<div class="post-metadata">

**Author:** ![applesauce](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@applesauce](https://forums.ankiweb.net/u/applesauce)\
**Post date:** [November 1, 2020, 11:03pm UTC](https://forums.ankiweb.net/t/card-creation-despite-blank-fields/4759/2 "2020-11-01T23:03:19Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/b/bc8045cc83987d823c3d7cd534964979adca30ce.png)

---

<div class="post-metadata">

**Author:** ![applesauce](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@applesauce](https://forums.ankiweb.net/u/applesauce)\
**Post date:** [November 1, 2020, 11:04pm UTC](https://forums.ankiweb.net/t/card-creation-despite-blank-fields/4759/3 "2020-11-01T23:04:01Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/7/7038f79b13f225a0667790f980fd783d725e9fe5.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/a/aeee05fe39d84f8c2aa56056a6d8165a101bf1d5.png)

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [November 2, 2020, 12:06am UTC](https://forums.ankiweb.net/t/card-creation-despite-blank-fields/4759/4 "2020-11-02T00:06:33Z")

</div>

From the docs:

You can also use conditional replacement to control which cards are generated. This works since Anki will not generate cards which would have a blank front side. For example, consider a card with two fields on the front:

```auto
{{Expression}}
{{Notes}}

```

Normally a card would be generated if either the expression or notes field had text in it. If you only wanted a card generated if expression was not empty, then you could change the template to this:

```auto
{{#Expression}}
    {{Expression}}
    {{Notes}}
{{/Expression}}

```

---

<div class="post-metadata">

**Author:** ![applesauce](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@applesauce](https://forums.ankiweb.net/u/applesauce)\
**Post date:** [November 2, 2020, 12:31am UTC](https://forums.ankiweb.net/t/card-creation-despite-blank-fields/4759/5 "2020-11-02T00:31:23Z")

</div>

Is there a way to retroactively change the code to delete cards that have been created without the conditional formatting ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/1/1f03c8f67b0e97c3749d9ee1375124e4a0325ced.png) ? I tried this but the cards still exist…

---

<div class="post-metadata">

**Author:** ![Rumo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/rumo/32/1505_2.png) [@Rumo](https://forums.ankiweb.net/u/Rumo)\
**Post date:** [November 2, 2020, 7:52am UTC](https://forums.ankiweb.net/t/card-creation-despite-blank-fields/4759/6 "2020-11-02T07:52:34Z")

</div>

Another snippet from the [manual](https://docs.ankiweb.net/#/templates/generation?id=card-generation-amp-deletion):

> When you edit a previously added note, Anki will automatically create extra cards if they were previously blank but no longer are. If your edits have made some cards blank when they previously were not, however, Anki will not delete them immediately, as that could lead to accidental data loss. To remove the empty cards, go to Tools → Empty Cards in the main window. You will be shown a list of empty cards and be given the option to delete them.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 7:41am UTC](https://forums.ankiweb.net/t/card-creation-despite-blank-fields/4759/8 "2023-05-01T07:41:43Z")

</div>


