
jbmia
Members-
Content Count
10 -
Joined
-
Last visited
Community Reputation
0 NeutralAbout jbmia
-
Rank
member
FileMaker Experience
-
Skill Level
Beginner
-
FM Application
19
Platform Environment
-
OS Platform
X-Platform
-
OS Version
Win 10, macOS (Big Sur)
-
Trouble parsing json with jsonGetElement
jbmia replied to jbmia's topic in Script Workspace and Script Triggers
Thanks !! Will update on my side. Again, much appreciation for the assistance. -
Trouble parsing json with jsonGetElement
jbmia replied to jbmia's topic in Script Workspace and Script Triggers
Comment, Your are the man! I was able to get this working using your example. Many thanks for going out of your way to solve this problem and build the demo file. It was very helpful Thank you so much! There were a couple additional wrinkles I had to solve: (1) data provider wants a whole number strike price as a single decimal (e.g., $65 must be 65.0) so I found a custom function, "NumberFormat", and converted the strike price before setting the $strike variable. (2) the instrument had to be sent as an upper (CALL, PUT), yet the JSON response is lower (call, put), so set var -
Trouble parsing json with jsonGetElement
jbmia replied to jbmia's topic in Script Workspace and Script Triggers
Wow. You guys are are awesome! Thanks comment for the demo file! I'm going to get on this today. John -
Trouble parsing json with jsonGetElement
jbmia replied to jbmia's topic in Script Workspace and Script Triggers
Thanks for the follow up... the challenge I'm having is that the path is dynamic and will need to be navigated based on submitting each variable: putExpDateMap.2021-02-19:46.52ยง5[ 2021-02-19 is the "expiration date", no issue building this. ":46" , I believe that this variable is the number of days between today and the expiration date... that shouldn't be too hard to calculate and insert into the request. ๐ Then there's the "52.5" which is the strike price..the only issue here being that "dot". Your solution looks like it would work, but I'd need to break down t -
Trouble parsing json with jsonGetElement
jbmia replied to jbmia's topic in Script Workspace and Script Triggers
Circling back around on this, I wanted to thank everyone who's contributed so far. It appears I still have some work to do on this one... I'm thinking perhaps I might look for an API that's a bit easier to navigate rather than jump through the hoops mentioned here. In the meantime huge thanks to you guys for taking time out of your day to respond to my questions. ๐ -
Trouble parsing json with jsonGetElement
jbmia replied to jbmia's topic in Script Workspace and Script Triggers
Looks a lot better than I could come up with... i'm a newb w/ scripting but can see where you're going with it... Many thanks! Here's what I get when I attempt to run the script: ? * Line 1, Column 1 Syntax error: value, object or array expected. I've attached a copy of the script itself in hopes there's something obvious I've done wrong... the json response detailed above is the result of the "Insert from URL" step below. Many thanks again for any assistance!! John -
Trouble parsing json with jsonGetElement
jbmia replied to jbmia's topic in Script Workspace and Script Triggers
Haha... I am getting from JSON.. I'm just trying to get the element "mark" from the response above... My issue is how to get down through this piece to "mark" to retrieve it: "putExpDateMap": { "2021-02-19:46": { "52.5": [ { ... "mark": 1.88, It seems this structure is composed of variables and might look something like this... "putExpDateMap.$date.$strike.mark, where, $date = 2021-02-19 $strike = 52.5 I did find a custom function, Parsing JSON with challenging "dot" keys (claris.com), that I'll give a try as a work around for the "dot" in 52.5 -
Trouble parsing json with jsonGetElement
jbmia replied to jbmia's topic in Script Workspace and Script Triggers
Ocean West, Thanks for the feedback... even though the "52.5" is a variable and inserted based on the set variable, "$strike"? John -
Trouble parsing json with jsonGetElement
jbmia replied to jbmia's topic in Script Workspace and Script Triggers
Thanks Agnes. I think I was a bit unclear above. In my attempt above: JSONGetElement( $json ; "$instrument&ExpDateMap.&$expiration&:46.&$strike&.mark" ) I neglected to detail out the variables I'm inserting into the request. These are: $instrument = call or put ("put" in this case..) $expiration = expiration date ("2021-02-19" in this case) $strike = strike price ("52.5") These are used in an attempt to traverse down through: "putExpDateMap": { "2021-02-19:46": { "52.5": [ { To get to: "mark": 1.88, I do -
jbmia started following Trouble parsing json with jsonGetElement
-
Hi Folks, New here and new to FM, but I'm making some good headway.. I've made my way into accessing stock quotes via one of the brokers API's and been successful parsing out the response for a straight stock quote. I'm now on to options quotes, which has a more complex json response... I've tried using generator and generator seems to stuck as well with a "?" in the field mapping for a key portion of the response. Here's the complete body: { "underlying": { "symbol": "KO", "bidSize": 700, "bid": 52.5, "close": 54.84, "mark": 52.51, "quoteTime": 16097877621