Brackets create a list. "[[40]]" is a list of lists">lists with one element "40". The play below
vars:
var1: [[40]]
tasks:
- debug: var=var1
- debug: var=var1[0]
- debug: var=var1[0][0]
gives:
"var1": [
[
40
]
]
"var1[0]": [
40
]
"var1[0][0]": "40"
manpreet
Best Answer
2 years ago
i have the following json output
The query below
gives
"msg": [ [40] ]
i want to convert into an integer so i can use this value. i tried everything, but all i want is to get number only without brackets. i also added
|int
in the end, but it gives me 0 value, which is weird.please help, i am really in trouble.