# Create maps only if fields are filled in

**URL:** https://forums.ankiweb.net/t/create-maps-only-if-fields-are-filled-in/26114
**Category:** Help
**Created:** [January 8, 2023, 3:18pm UTC](https://forums.ankiweb.net/t/create-maps-only-if-fields-are-filled-in/26114 "2023-01-08T15:18:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![elias17](https://avatars.discourse-cdn.com/v4/letter/e/34f0e0/32.png) [@elias17](https://forums.ankiweb.net/u/elias17)
#### Post date: [January 8, 2023, 3:18pm UTC](https://forums.ankiweb.net/t/create-maps-only-if-fields-are-filled-in/26114/1 "2023-01-08T15:18:38Z")

</div>

I try to be as productive as possible in creating my maps and don’t want to duplicate certain things. That’s why I’m asking how I can “program” the cards so that they are only created when the required fields are present.

I hope someone can help me with this.

---

<div class="post-metadata">

### Author: ![ODeer](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/odeer/32/10217_2.png) [@ODeer](https://forums.ankiweb.net/u/ODeer)
#### Post date: [January 8, 2023, 6:08pm UTC](https://forums.ankiweb.net/t/create-maps-only-if-fields-are-filled-in/26114/2 "2023-01-08T18:08:27Z")

</div>

[Conditional Replacement does exactly what you want.](https://docs.ankiweb.net/templates/generation.html?highlight=condition#conditional-replacement)

Say you only want to create the card if the field `Map 3` has content in it, you create a card with the following Front layout:

> {{#Map 3}}
> 
> Whatever content you want to go on this card goes here. Maybe it references {{Map 3}}, but doesn’t even have to.
> 
> {{/Map 3}}

This will leave the front side empty if that field is empty. Anki is smart enough to discard the card if the front is empty.

---

<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: [February 7, 2023, 6:08pm UTC](https://forums.ankiweb.net/t/create-maps-only-if-fields-are-filled-in/26114/3 "2023-02-07T18:08:28Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
