The variable $responseCode is not bound in the current context

703 views
Skip to first unread message

Steev

unread,
Apr 2, 2017, 1:31:27 PM4/2/17
to mitappinv...@googlegroups.com
I'm trying to follow this example
in parsing a only response from the webserver

The response is {"member_name":"Steven V.","member_status":"Good Standing","member_style":"registryFormConfirm"} and I can display that response just fine but now I'm trying to make it look pretty.

It's been 14 years since I granted from DeVry with an IT familiarization degree so about all I know is that I don't know squat, and don't often even know the right question to ask. I've done some hunting and learned how to DoIt and I think my problems start at the get with, "The variable $responseCode is not bound in the current context."

Any ideas?


Message has been deleted

Taifun

unread,
Apr 2, 2017, 1:35:29 PM4/2/17
to MIT App Inventor Forum
Do it works only for global variables...

generally: JSON and list of lists: example1 and example2

and if you want to add a screenshot into your thread, see here how to do it


Taifun
      

Steev

unread,
Apr 2, 2017, 3:00:39 PM4/2/17
to mitappinv...@googlegroups.com
That seems to be a better way than using the startTag and endTag method in the other example, but I'm still struggling.

Should I be able to do all this within when Web1.GotText, e.g.

set txtName.Text to look up pairs in key="member_name"
  pairs get=jsonResponse
  notFount="Error"
?

Taifun

unread,
Apr 3, 2017, 9:20:00 AM4/3/17
to MIT App Inventor Forum
Should I be able to do all this within when Web1.GotText
yes
Taifun
Message has been deleted

Abraham Getzler

unread,
Apr 3, 2017, 8:30:27 PM4/3/17
to MIT App Inventor Forum
The order in the blocks image looks wrong.

A Web1.JSONTextDecode needs to be done just once, early in the 
decoding process, before all the lookup-in-pairs blocks,
because it is the block that takes the JSON text and turns it
into a bush of nested pairs.

ABG

Reply all
Reply to author
Forward
0 new messages