Home:ALL Converter>Dynamic key in data passed to template

Dynamic key in data passed to template

Ask Time:2012-09-21T23:42:38         Author:user1076371

Json Formatter

How do I access a dynamic key in the template?

If the data coming from the server is of the following format:

hash = { 'User001' : { 'LastLoggedIn' : '42301', 'Name' : 'John' }, 'user' : 'User001' }

If I want to use the User001.Name in my template, how do I do it? I will know it is 'User001' or 'User002' only from the 'user' attribute!

Author:user1076371,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/12533775/dynamic-key-in-data-passed-to-template
yy