# How to get the values from JSON that is VARCHAR type

**URL:** <https://community.dremio.com/t/how-to-get-the-values-from-json-that-is-varchar-type/8542>\
**Category:** Uncategorized\
**Created:** [December 22, 2021, 1:26pm UTC](https://community.dremio.com/t/how-to-get-the-values-from-json-that-is-varchar-type/8542 "2021-12-22T13:26:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greeengooo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/greeengooo/32/3814_2.png) [@Greeengooo](https://community.dremio.com/u/Greeengooo)\
**Post date:** [December 22, 2021, 1:26pm UTC](https://community.dremio.com/t/how-to-get-the-values-from-json-that-is-varchar-type/8542/1 "2021-12-22T13:26:05Z")

</div>

I need to get the fields from JSON that is stored in VARCHAR. In addition this should be done within one SELECT statement without wrapper.  
For e.g.

What I need(this is obviously not a valid sql, just for clarification of what I need):  
_ **SELECT** _  
_**CONVERT\_from(column\_in\_varchar, ‘JSON’).data**_  
_ **FROM table** _

The following code is unacceptable:  
_ **SELECT t.column\_in\_json.data** _  
_ **FROM** _  
_**(SELECT CONVERT\_FROM(column\_in\_varchar, ‘JSON’)**_  
_**FROM table));**_

Do you have any ideas?

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [December 22, 2021, 10:01pm UTC](https://community.dremio.com/t/how-to-get-the-values-from-json-that-is-varchar-type/8542/2 "2021-12-22T22:01:02Z")

</div>

@Greeengooo

use CONVERT\_FROMJSON(\<‘string-value-in-JSON-format’\>), once done the icon for column will change from a string (ABC) to a struct, then you can do `<column_name[0]` for 1st field or if you know the column name then do `<struct_name>.<column_name>`
