SugarSmarty JSON data handling from DB field

I have a custom field type and in the edit view, i am saving the value in the field as

The data is saved correctly in the database for the field value. Below is a sample of the data save for one record.


Now in order to manipulate the saved data in the DetailView.tpl of the field, have following code.

{assign var="valueJSON" value={{sugarvar key="value" string=true}}}

{foreach from=$valueJSON item=fileValues key=FileIndex}
  {assign var=fileItem value=$fileValues|json_decode:1}

The above code does not print anything in the detail view for the field. However if i provide {$valueJSON} value in the TPL, it gives the exact JSON stream ( [{“file_name”:"banner.png…) .

How can i loop through the values or change this $valueJSON to proper json object to access values.