Strange behavior of "get value for key" block

When I right-click and select "Do It" for this block:

blocks (2)

and input

{"time":"2023-11-07 00:00"}

as the value for "item", I get a result of:

Do It Result: "not found"

What am I doing wrong?

This is what I'm trying to get at:

I want to get the hour in the timestamp and use it as a number.

Is item a dictionary, or is it JSON text that has not yet been converted into a dictionary?

Item is a json parsed with jsonDecodeWithDictionaries, but it throws an error in testing the app.

Add some global variables to catch the trail of intermediate results for Do It, starting with item.
Throw in an extra step evaluating IS A Dictionary(item) for good measure.

Ah, using is a dictionary? on item returns false.

Found the issue with that block.
Way back in the code I found that my object was a list, not a dictionary.
That made a lot of the code nonfunctional.
Got it fixed.

Thanks for your help.

1 Like

Just to round this off:

(the jsontextdecode block is found in the web component)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.