# Getting different error when trying reference with ref number of list and exact string name

**URL:** <https://forum.ansible.com/t/getting-different-error-when-trying-reference-with-ref-number-of-list-and-exact-string-name/30782>\
**Category:** Ansible Project\
**Created:** [July 15, 2019, 11:28am UTC](https://forum.ansible.com/t/getting-different-error-when-trying-reference-with-ref-number-of-list-and-exact-string-name/30782 "2019-07-15T11:28:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rakesh\_Parida](https://avatars.discourse-cdn.com/v4/letter/r/3ab097/32.png) [@Rakesh\_Parida](https://forum.ansible.com/u/Rakesh_Parida)\
**Post date:** [July 15, 2019, 11:28am UTC](https://forum.ansible.com/t/getting-different-error-when-trying-reference-with-ref-number-of-list-and-exact-string-name/30782/1 "2019-07-15T11:28:54Z")

</div>

iam getting the proper value if i use the Reference number of list in my input file (3 is entry for EIL\_adaptor).

Now if i try “ABC” instead of 3 it gives error

tasks:

- name: Set file as variable  
include\_vars:  
file: “{{ input\_file }}”  
name: x

- name: Debug  
debug:  
msg: “{{ x[‘deliveries’][0][‘releases’][0][‘latest\_RC25’][3]}}”

TASK [Debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> {  
“msg”: {  
“ABC”: {  
“file\_name”: “abc”,  
“md5”: “”,  
“product\_name”: "ABC,  
“product\_number”: “ABC 902 7815”,  
“release\_candidate”: “RC25”,  
“version”: “25.1.0”  
}

tasks:

- name: Set file as variable  
include\_vars:  
file: “{{ input\_file }}”  
name: x

- name: Debug  
debug:  
msg: “{{ x[‘deliveries’][0][‘releases’][0][‘latest\_RC25’][ABC]}}”

It gives an error.
