Select/Dropdown with json as value

I have a query resource that has this sql query

select label, jsondata from table

Now I'm trying to build a select/dropdown that is mapped to above query resource.

However, when I map the query's jsondata to the dropdown's value I get this error:

How can I fix this to be able to use json as value?

It looks like your JSON contains some empty strings. If they are always empty, cleaning up the JSON would help. If they are dynamic, you sometimes have to push through the errors.

@Chris_Skiles good point and I double checked. I have 5 rows returned by the query and all fields are populated... I wonder if this is a bug... Perhaps the json field name companyid makes retool think there are duplicates? Not sure...

if you narrow it down to item.jsondata.companyid, does the error go away?

:wink: item.jsondata[0].companyid

1 Like

What about it you stringify the JSON?

Thanks @Chris_Skiles and @bobthebear. Using item.jsondata[0].companyid made the error go away!

1 Like

happy to see you found a solution!! feel free to mark @Chris_Skiles's post as the solution so other searching can easily find this... if you don't mind and have the time that is :beers:

1 Like