REXYGEN Community Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Login

    Json array decoding

    REXYGEN Studio
    2
    2
    481
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hubert
      last edited by

      Hello everyone,

      I'm looking for a way to decode a JSON response from HTTP2 block.
      I need to decode a JSON array: one of the json fields value is an array.

      I tried first decode JSON to string, one of the field is an json array - so I connected another JSON-decode block. PJSOCT output -> PJROCT jtxt input

      Unfortunately block is in error state:

      103 General input variable error
      

      But I think there is no output from the PJSOCT block - what is expected behaviour in such case?

      Regards
      Hubert

      1 Reply Last reply Reply Quote 0
      • cechuratC
        cechurat
        last edited by

        Hi Hubert,

        thank you for your question. It would be much more easier to answer if you can share project files which shows the example of such JSON string and function block settings.

        If you want to access JSON array, just use "[x]" notation, i.e. weather[0].main (means field "main" in 1st item of "weather" array) - see "0302-04 OpenWeatherMap API" example.

        Hope it helps.

        Regards, Tomas

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        This is a community forum for REXYGEN users and fans. Detailed information can be found at REXYGEN homepage.

        There is also an outdated REXYGEN community forum.

        Powered by NodeBB.