Written by

Developer at Matirx, Israel
Question Nael Nasereldeen · Aug 31, 2017

jsonProvider - handling underscore character

Hi guys,

How do you deal with underscore characters when using jsonProvider  and exporting or importing ?

for example:

USER>s jsonString="{""what"":""1"",""up"":""2"",""test_test"":""3""}"
 
USER>set status = ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject(jsonString,,.outputObj)
 
USER>w outputObj.what
1
USER>w outputObj.up
2
USER>w outputObj.test_test
 
W outputObj.test_test
^
<UNDEFINED> *test

we found out that we can access it like this, but not sure if it's the recommended method-

w outputObj.%data("test_test")

Regards,

Nael

Comments

Nael Nasereldeen  Aug 31, 2017 to Dmitry Maslennikov

Thanks Dmitry!

Is that documented?

0
John Murray  Sep 5, 2017 to Nael Nasereldeen

Alongside the "ANSWER" header, look for a checkmark that you can click. This screenshot highlights where:

0
Nael Nasereldeen  Sep 5, 2017 to John Murray

Ok good to know thanks.

I accepted.

Its not east to notice it in my opinion.. but maybe it's just me.

Thanks,

Nael

0
Evgeny Shvarov  Sep 5, 2017 to Nael Nasereldeen

Hi, Nael! Thanks for that! It makes DC more useful.

There is DC FAQ tag which illustrates this and other features of DC! HTH.

0
Evgeny Shvarov  Sep 5, 2017 to John Murray

John, please share your ideas on this feature improvement.

0
John Murray  Sep 5, 2017 to Evgeny Shvarov

Maybe display the unchecked marks to the OP using a jazzy animation. Make it irritating enough and perhaps they'll get around to accepting an answer just to calm their screen down wink

0
John Murray  Sep 5, 2017 to Nael Nasereldeen

It's not just you. The DC UI needs improving in this area, IMO.

0
Evgeny Shvarov  Sep 2, 2017 to Nael Nasereldeen

Hi, Nael!

If the answer suits your question, would you please accept it?

TIA!

0