How to reference a value in a JSON string?

Discussion in 'Programming' started by dizid, Feb 15, 2010.

  1. #1
    Hi,

    After many hours of puzzling :rolleyes: i decided to post my question here.

    I have a simple JSON string returned from bit.ly:
    { "errorCode": 0, "errorMessage": "", "results": { "http://www.averylongexampleurl.net": { "hash": "1nRtGA", "shortCNAMEUrl": "http://bit.ly/aKZF0Q", "shortKeywordUrl": "", "shortUrl": "http://bit.ly/aKZF0Q", "userHash": "aKZF0Q" } }, "statusCode": "OK" }

    I deserialized this JSON string and cfdumped the resulting variable <cfreturn deserializejson(output.filecontent)>
    It is a struct in a struct (in a cfdump-struct)
    Now, i want the use the value "http://bit.ly/aKZF0Q" but don't know how to reference that value with dot-notation, like this #output.results.???.shortUrl#

    An image of the cfdump is here: http://farm5.static.flickr.com/4040/4359424173_f480cab58b_o.jpg

    Anyh help appreciated.
     
    dizid, Feb 15, 2010 IP
  2. dizid

    dizid Member

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    [​IMG][/IMG]
     
    dizid, Feb 15, 2010 IP