JSON key with special Character($)

Hi everyone, I have an API response where one of the keys in the JSON response is a $ sign. for example

response { 
...
category{
    $nCat : "something",
    $sCat : "some other things"
}
...
}

Now, when I’m trying to parse this inside a for-each loop,

for each video in allVideos
gridposter.category = video.category.$nCat
...
end for

The error is ‘Syntax error: unexpected character $’

is there a way to parse this JSON? Thanks in Advance :slightly_smiling_face:

Prior to parsing, do a string replace for the $.
temp=strreplace(readInternet,“$”,“z_”)

Function strReplace(basestr As String,oldsub As String,newsub As String) As String
	newstr=""
	i=1
	While i<=Len(basestr)
		x=Instr(i,basestr,oldsub)
		If x=0
			newstr=newstr+MID(basestr,i)
			Exit While
		End If
		If x>i
			newstr=newstr+MID(basestr,i,x-i)
			i=x
		End If
		newstr=newstr+newsub
		i=i+Len(oldsub)
	End While
	Return newstr
End Function

Or you can probably try

gridposter.category = video.category["$nCat"]

Thanks a lot for the quick response, i was looking through associative array methods and doing

video.category.Lookup("$nCat")

worked for me.

cool