Message Boards Message Boards

0
|
83 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Retrieving URLQueryString elements?

Posted 1 day ago

I have a URLQueryString that WL has interpreted per the following screenshot:

enter image description here

...which appears to be a set of Rules. I can't figure out how to retrieve the value of "checkin" from this input and then ImportString it as RawJSON to create a Dataset because WL keeps complaining that it's not a String.

POSTED BY: Steven Buehler
4 Replies
Posted 1 day ago

I'm not entirely clear on what you want, but interpreting "how to retrieve the value of 'checkin'" literally, you can do this:

"checkin" /. j

or

Query["checkin"][j]

So, to get the json,

ImportString[Query["checkin"][j], "RawJSON"]

Also, it would help if you formatted your code to be copy-paste-able.

POSTED BY: Eric Rimbey

Correction to your answer: Should be Query["checkin"][k] ... why Wolfram couldn't make this consistent is beyond me (with Dataset and Association I'd use k[["checkin"]]).

POSTED BY: Steven Buehler
Posted 1 day ago

Um....where does the k come from?

POSTED BY: Eric Rimbey

Oops, my bad; the script I'm implementing this in uses j as the raw query text while k is the Interpreter value. Forgot I had copied this from my testbed. :-)

POSTED BY: Steven Buehler
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract