Skip to main content
Contributor
June 4, 2020

Technical Note: [FortiSOAR / Cybersponse Tricks'n'Tips] Getting 'built-in method values of dict object' while accessing dict in jinja

  • June 4, 2020
  • 1 reply
  • 1810 views
Description

{

    "data": {

        "values": [ "value1", "value2" ]

    }

}


When accessing an element of a dict data as {{data[values]}} or {{data.values}} it expect to get the corresponding value as a result, but it throws error <built-in method values of dict object at 0x7f0a12b79af8>.


To get corresponding value in such case use .get() as below


{{data.get('values')}}


OUTPUT:


['value1', 'value2']


1 reply

rrighi
Staff
Staff
June 4, 2025

Thank you very much Andy! That helped me a lot! I was fighting against jinja dictionaries and arrays. The method get you mentioned was the solution.