-4

I have the JSON like this:

{"message":"[{\"file_name\":\"1464312906_84174_upload.jpg\",\"file_url\":\"uploads\\/tmp\\/1464312906_84174_upload.jpg\"}]","code":200}

How to get the string "1464312906_84174_upload.jpg" by JSON Expression?

slebetman
  • 109,858
  • 19
  • 140
  • 171
Nadie
  • 13
  • 3

1 Answers1

0

message appears to be a JSON-encoded array. So parse it and then access the property you want.

JSON.parse(data.message)[0].file_name

Replace data with the variable containing the object you showed in the question.

Barmar
  • 741,623
  • 53
  • 500
  • 612