# if defined for nested dict value

**URL:** <https://forum.ansible.com/t/if-defined-for-nested-dict-value/18738>\
**Category:** Ansible Project\
**Created:** [July 12, 2015, 8:19pm UTC](https://forum.ansible.com/t/if-defined-for-nested-dict-value/18738 "2015-07-12T20:19:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rob3](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@rob3](https://forum.ansible.com/u/rob3)\
**Post date:** [July 12, 2015, 8:19pm UTC](https://forum.ansible.com/t/if-defined-for-nested-dict-value/18738/1 "2015-07-12T20:19:19Z")

</div>

Hi

I would like to check if nested dict value is defined, eg.:  
when: ansible\_local.resolver.resolver\_override is not defined

But if ansible\_local (fact.d) is not exists I get error message:  
error while evaluating conditional: ansible\_local.resolver.resolver\_override is not defined

Is there any way to create condition if nested dict value is defined regardless of existence the whole dict hierarchy?
