1
0
-1

How would I setup the JSON Tool to capture:  Puts values ContractSymbol, strike and currency when I receive the below compacted result of my API call??

I have tried with this, but no luck:

{

  • "optionChain":{
    • "result":[
      1. {
        • "underlyingSymbol":"AAPL",
        • "expirationDates":,
        • "strikes":,
        • "hasMiniOptions":false,
        • "quote":,
        • "options":[
          1. {
            • "expirationDate":1631836800,
            • "hasMiniOptions":false,
            • "calls":,
            • "puts":[
              1. {
                • "contractSymbol":"AAPL210917P00027500",
                • "strike":27.5,
                • "currency":"USD",
                • "lastPrice":0.01,
                • "change":0,
                • "percentChange":0,
                • "volume":20,
                • "openInterest":2614,
                • "bid":0,
                • "ask":0.01,
                • "contractSize":"REGULAR",
                • "expiration":1631836800,
                • "lastTradeDate":1631303338,
                • "impliedVolatility":4.500004375,
                • "inTheMoney":false
                },
    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      Hello,

      Perhaps you can try out this plugin from JogetOSS Github page, called the Enhanced JSON ToolThis plugin was created to solve use cases where we need to format the JSON response of a JSON API call before storing data into a form or workflow variable. The configurations are exactly similar to the default bundled JSON Tool in Joget, just with an additional optional property to write bean shell script to format/modify the JSON response.

      Its related KB and sample app w/ plugin is also here: Enhanced JSON Tool Plugin

      Hope this helps!

      1. Erik Jarlstrom

        Perfect.. thanks for the response. Will check it out

      CommentAdd your comment...
    2.  
      1
      0
      -1

      Hi, from the response it's not clear which data is repeated. Assuming the "puts" is repeated, perhaps you could try using "optionChain.result[0].options[0].puts" as the Base JSON Object, and just "contractSymbol, "strike" and "currency" in the field mapping.

        CommentAdd your comment...