# Key generation with conditions?

**URL:** <https://discourse.jabref.org/t/key-generation-with-conditions/486>\
**Category:** Help\
**Created:** [March 3, 2017, 1:34pm UTC](https://discourse.jabref.org/t/key-generation-with-conditions/486 "2017-03-03T13:34:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![buhtz](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/buhtz/32/372_2.png) [@buhtz](https://discourse.jabref.org/u/buhtz)\
**Post date:** [March 3, 2017, 1:34pm UTC](https://discourse.jabref.org/t/key-generation-with-conditions/486/1 "2017-03-03T13:34:35Z")

</div>

Is there a way to use conditions for the key generation patterns?

e.g. for “Online” or "WWW"  
IF “author” and “year” is given: [author][year]  
IF “author” and NOT “year”: [author]  
IF NOT “author”: [veryshorttitle]

**EDIT** : Please move this to FeatureRequest section if this is not possible. This is very relevant for Website (WWW, Online, Unpublished) entries. The meta-data for that has often very low quality and is far away from being complete. So there are a lot of “cases” need to be consired when generating a key of such entries. This are kind of entries I don’t want to edit manualy.
