37. (Advanced Programming In Access 2013) Importing JSON To A Table From A RESTful Web API

  Рет қаралды 32,661

Programming Made EZ

Programming Made EZ

Күн бұрын

Пікірлер
@courtneystearns8680
@courtneystearns8680 7 жыл бұрын
Hi Steve. This is a fantastic post. I particularly appreciate how you focused on the minimum viable product to help one work with XML and JSON in VBA. When I was ready for more, I reviewed one of your other videos that went deeper into the weeds of the how the XML and JSON header, detail and action verbs work. I was able to use this to integrate web applications with local ERP systems and it worked like a champ. More importantly, I have now have a framework and tool set to make future integrations far easier to accomplish. Thank you very much!
@bobalston7399
@bobalston7399 3 жыл бұрын
Wonderful video. thank you. any chance you can post the Access database to avoid all the cut n paste and especially the properly setting up of the class object?
@jabariprice6254
@jabariprice6254 4 жыл бұрын
The link you provided (code.google.com/archive/p/vba-json/) has been archived on google. Do you know were else I could find the vba-json code? Thanks.
@swapnilwankhede3440
@swapnilwankhede3440 7 жыл бұрын
Hi Steve Excellent Tutorials, Thanks a lot Steve for uploading this videos, it’s really helpful, never found such good videos.
@SAMYTAHER
@SAMYTAHER 4 жыл бұрын
thank you for the interesting, beautiful explanation
@Lamborgful
@Lamborgful 5 жыл бұрын
Great video. If I've been given a txt file formatted as .json how do I utilise the parser to push the records into a table. The txt file has 500,000 records in it?
@terjegundersen1235
@terjegundersen1235 7 жыл бұрын
Terje Gundersen Thank's for your great video. Do you have any plans for a tutorial that explains how to update from a table in Access back to the webserver in Json format?
@chenhuiboy
@chenhuiboy 6 жыл бұрын
Hi Steve, I just your useful video. However, the vba-jason class link doesn't work anymore. I tried google it, but No Luck. Would you be able to send me another link for this source code? Thanks in advance.
@tarunprakashsingh
@tarunprakashsingh 3 жыл бұрын
hey is there a way parse and store values from JSON with out knowing the data structure. example how many Items/sub-items or rows it will have. Trying to build something where it can parse any JSON to a excel Sheet. Any help would be really great. Thanks
@tibtill
@tibtill 7 жыл бұрын
Hi, Steve. Thank you very much for sharing with us a quite important part of your gold-mine knowledge. Importing JSON to a table is something I was wondering how to do for a very long time. However, I have a very specific situation: like somehow first I need to POST something on the webserver and then GET associated data to my request. So, as you understand, I'd love to know if I can use Access VBA to send (POST) my demand, as well. For example: let's say I have some partners and I have the opportunity to send (POST) a list (an array) of IDs and current data [{"ID":1234,"Date":"2017-09-30"},{"ID":3456,"Date":"2017-09-30"} ...] and get back from the webserver another array containing the ID, request date, partner name, code of activity and True/False if the partner is still active... could you help me? Thank you.
@ΠΑΝΑΓΙΩΤΗΣΑΝΤΩΝΕΛΛΟΣ-ζ9φ
@ΠΑΝΑΓΙΩΤΗΣΑΝΤΩΝΕΛΛΟΣ-ζ9φ 4 жыл бұрын
Hello, I get an error message "Certificate Authority is invalid or incorrect." after they (host) updated there ssl certificate on the server.
@worawutmaneeruja2881
@worawutmaneeruja2881 6 жыл бұрын
Thank you for this useful video. Just wonder if there is any code for creating from scratch the table from JSON respondText. Thank you in Advance.
@schalld1
@schalld1 Жыл бұрын
is there a way in vba to know which response type we are getting so we can then execute json parser vs xml parser
@ProgrammingMadeEZ
@ProgrammingMadeEZ Жыл бұрын
If the body begins with a < then it's XML. If it begins with { or [ then it's JSON.
@yvettethompson
@yvettethompson 9 жыл бұрын
THANK YOU SO MUCH for these videos! They are wonderful. My API import into Access is getting held up on the first record - I am suspecting it is because we use colons in one of our fields. I would love to send you 2 screen shots where I am stuck. Is that possible? Thank you again, Yvette
@ProgrammingMadeEZ
@ProgrammingMadeEZ 9 жыл бұрын
+Yvette Thompson What makes you think it's the colon that's the problem?
@yvettethompson
@yvettethompson 9 жыл бұрын
It is not the colon. Now I am suspecting tha it is an extra nest of "{" at the beginning that says DATA: here is my reader.responseText: ? reader.responseText {"data":[{"ID":"55f9fa5900aa06c2bfdc4c297244c12c","name":"Marketing Initiatives Calendar","objCode":"PROJ","DE:Job Code":"200628--Special-18268","DE:Server Location":"M:\\MARKETING\\Marketing\\\\Marketing Initiatives Calendar\\Missing Medium"},{"ID":"55fa06dd00ac6e797b3dd89502c1fe87","name":"Marketing Work Request","objCode":"PROJ","DE:Job Code":"150826---19070","DE:Server Location":"M:\\MARKETING\\\\\\Marketing Work Request\\Missing Medium"},{"ID":"55fa06ed00ac6fc31ee0d5bae9706ce5","name":"Plan and Design Workfront Implementation","objCode":"PROJ"},{"ID":"561d48a3001d8d6f2100be8c911f903e","name":"IT Request Queue","objCode":"PROJ","DE:Job Code":"211001","DE:Server Location":"M:\\MARKETING\\Human Resources\\ITTessi\\\\Missing Medium"},{"ID":"561d4a3a001f1e4eee983b1b884aa693","name":"IT Work Request","objCode":"PROJ"},{"ID":"562a1d5600ab15f859946948c5b71d5e","name":"RP: 2015 - 11\/04 Members FTLN, Meet Your Mammoth, Membership as Gift, CoL, KidsClub at DMA","objCode":"PROJ","DE:Job Code":"151104-Eblast-eBlast s-100938","DE:Server Location":"M:\\MARK
@victoriafriess9805
@victoriafriess9805 7 жыл бұрын
This has been really helpful. Thank you for your efforts in teaching this. I have run into a type mismatch error when attempting to add a new record into my table. This is my first stab at importing JSON into MS Access, and I feel like I am VERY close. Any pointers on how to get over this hump?
@colddonkey
@colddonkey 7 жыл бұрын
I'm realizing that my (same guy, different log in) json site starts with this: {"Data":[{"Id":17,"SpiPartNumber":"COM.0631E","LinkCode":"AF1JAST1COM.0631E","Description":null,"CustomerPartNumber":null,"StandardPackQty":40," I think the first {"Data": might be to blame?? I need the fields after the initial {"Data"...what would be the best way to approach this? Sorry for being a newbie :-/
@colddonkey
@colddonkey 7 жыл бұрын
Well...for now, I just trimmed off the first 8 characters of the string and it seems to be working as intended. Maybe I can get some sleep now...:-)
@yvettethompson
@yvettethompson 8 жыл бұрын
Now I have an integer in my Collection and Thing.Item("IntegerField") won't work. Any ideas? THANK YOU
@timaxproductions
@timaxproductions 6 жыл бұрын
Thank you for the video! Please help me to resolve one issue. Followed your tutorial and everything works except that I fetch the same data from API unless I restart access... Do I need to close any connections everytime I fetch new data or anything?
@chrisvanderhaar9278
@chrisvanderhaar9278 8 жыл бұрын
Hello Steve, First of all, all the compliments to you for all of your video's. The are clear and even for me good to understand. The above video of importing JSON is working for me. But there is one small problem with the inoported JSON file. The file i have to import has an extra child node in it. The Ulr is json.jmt.nl/?ver=2 These are furniture that we also want to import in our database. Is there a way of importing the child nodes as well? Perhaps you have a tip for me how i must work this out.
@carloscollao3850
@carloscollao3850 6 жыл бұрын
Hi JJ Dasher I have the same problem : I get a runtime error 13 Type Mismatch on the line "Set Coll = json.parse(reader.responseText)". Any ideas?
@twopeaksendurance
@twopeaksendurance 5 жыл бұрын
This function gives the Json without the first "wrong" part: Function jsonkurz(Json As String) As String Dim i As Integer Dim lengthjson As Integer i = 1 Do Until Mid(Json, i, 1) = "[" i = i + 1 Loop i = i - 1 lengthjson = Len(Json) jsonkurz = Right(Json, lengthjson - i) End Function and in the main function: If reader.status = 200 Then Set db = CurrentDb Set rs = db.OpenRecordset("tblSteuern", dbOpenDynaset, dbSeeChanges) Jsonshort = (jsonkurz(reader.responseText)) Set coll = Json.parse(Jsonshort)
@snoble1978
@snoble1978 7 жыл бұрын
Can anyone help point me to this code? i am trying the link and the comments below but not able to source the code. Thanks!
@JJsMessyBench
@JJsMessyBench 9 жыл бұрын
I've been trying for hours to get this to work. The JSON parsing class seems to work, but once it comes back to the module, I get a runtime error 13 Type Mismatch on the line "Set Coll = json.parse(reader.responseText)". Any ideas?
@ProgrammingMadeEZ
@ProgrammingMadeEZ 9 жыл бұрын
+JJ Dasher Did you compare it to the work files?
@BrianJohnson-os6tu
@BrianJohnson-os6tu 8 жыл бұрын
JJ Dasher: Did you ever figure this issue out? I am having the same problem and see no difference between my references or work files.
@BrianJohnson-os6tu
@BrianJohnson-os6tu 8 жыл бұрын
Steve: Firstly thank you for all of the videos. I know nothing about programming and have learned a ton from them. I asked JJ Dasher if he resolved this issue but probably should have asked you directly. I get this error in my DB, but not in your work files even though all the same. I assume I am missing a reference?
@ProgrammingMadeEZ
@ProgrammingMadeEZ 8 жыл бұрын
I'm thinking it has to do with the data and the parser. If the JSON starts with a { then the parser will return a Dictionary. If the JSON starts with a [ then it will return a collection. So since the variable we are trying to set the result to is a collection, but the JSON starts with a { then we'll get a type mismatch since the parser will be returning a dictionary instead of a collection.
@BrianJohnson-os6tu
@BrianJohnson-os6tu 8 жыл бұрын
You are good. I kept running the code trying to figure out the issue and when I hover over the line in question I get reader.responseText"{. I switched the variable from collection to dictionary and this allowed code to jump this error, but the value remains the same and my rs items all error on null. Thank you for your help and I will see if I can muddle around and work it out.
@pjamiesonnz
@pjamiesonnz 8 жыл бұрын
Another great Video Steve. I have one main problem immediately - Pretty much all my tables have a hyphen (-) in the name as well as most fields. This caused VBA to error out as soon as I type the code as it thinks it's a subtraction. I've tried putting quote marks and square brackets around and this does not work.
@ProgrammingMadeEZ
@ProgrammingMadeEZ 8 жыл бұрын
Hyphens in names of things in general is bad. If anything use underscores, but you can get around this in most cases by surrounding your tablenames or column names with []'s when you call them. So My-Table would be [My-Table] in your query.
@pjamiesonnz
@pjamiesonnz 8 жыл бұрын
I have no control over the tables, it's a global system. The brackets have worked, thanks!
@PatrickChalier
@PatrickChalier 9 жыл бұрын
Hello, great tutorial thanks ! Unfortunately the vba-json code on google seems to have dissapeared ! Could you upload it to pastebin maybe ? Thanks in advance, Patrick.
@ProgrammingMadeEZ
@ProgrammingMadeEZ 9 жыл бұрын
+Patrick Chalier It is in the work files.
@jmonti777
@jmonti777 8 жыл бұрын
The code in the link is no longer there. Any way you could post it here or somewhere we can grab it? Thank you so much
@ProgrammingMadeEZ
@ProgrammingMadeEZ 8 жыл бұрын
I just tried it and it seems to be working fine for me. That link is just to the root folder of the project files. You have to go to the folder where the file is located.
@jmonti777
@jmonti777 8 жыл бұрын
when you say where the file is located where would that be? I see the project folder which is where it takes me. then I see the source, issues, wikis, and downloads links to the left. I have drilled down to the source then again to the source. I have downloaded the code in that window. yet I am not sure which is the code or file to use. I apologize for this as I am a newbie. trying to learn. thank you so much
@ProgrammingMadeEZ
@ProgrammingMadeEZ 8 жыл бұрын
When you go to the link in the description it should take you to a google drive location. From there you will see multiple folders, and they begin with a number. The number corresponds to the number of the video, so this video is #37 and the work files folder you're looking for starts with 37.
@mattseweryniak7016
@mattseweryniak7016 8 жыл бұрын
The link in the description is not working - it is providing error 406 requires you to sign on, - after signing in to youtube/google still getting that
@yvettethompson
@yvettethompson 8 жыл бұрын
Thank you so much for your wonderful training. I would love to pay you for your support (I need some more help!) I have successfully imported nested loops(collections) into Access using your video. I am now stumped with a situation where I ask for fields=parameterValues and it returns a list of custom fields. When it is another collection then it has a bracket "[" and I know how to grab that. But this doesn't, and I am having trouble grabbing the values. In my example I ask for fields= resolvables, parameterValues. The resolvables is another collection, but what the heck is the parameterValues? (It is some sort of a list) I can't use the Thing.Item() to grab the fields... Here is how it returns: _________________________________________________________________________________ "data": [ { "ID": "566897750011d716ac10b4a71c59ae64", "name": "RP: Winter Wonderland Sleepover PDF for Registered Guests", "objCode": "PROJ", "status": "CPL", "resolvables": [ { "ID": "56689708001178a381b30dcca2abd03d", "name": "Winter Wonderland Sleepover PDF for Registered Guests", "objCode": "OPTASK" } ], "parameterValues": { "DE:TemplateCalc": "Layout - PDF Layout", "DE:FilePath": "M:\\MARKETING\\Sales\\Sleepovers\\Winter Wonderland Sleepover PDF for Registered Guests\\In-Museum Digital Signage\\151211-PDFLayout-Sleepovers-110203-CM\\", "DE:PlannedDateCode": 151211, "DE:SubCodeCalc": "Sleepovers", "DE:Job Code": "151211-PDFLayout-Sleepovers-110203-CM", "DE:Designer": "CM", "DE:Department": "SAL - Sales", "DE:Server Location": "M:\\MARKETING\\Sales\\Sleepovers\\Winter Wonderland Sleepover PDF for Registered Guests\\In-Museum Digital Signage", "DE:Medium": "In-Museum Digital Signage", "DE:Digital Elements": "PDFLayout - PDF Layout", "DE:Sales Products": "Sleepovers - Sleepovers ///FAMILY ADVENTURES ////EARNED REVENUE", "DE:ElementCalc": "PDFLayout", "DE:Element Format": "Digital", "DE:SubCode": "Sleepovers", "DE:DeptCalc2": "SAL", "DE:Name1": "RP Winter Wonderland Sleepover PDF for Registered Guests", "DE:CreativeFilePath": "M:\\CREATIVE\\SAL\\151211-PDFLayout-Sleepovers-110203-CM\\", "DE:SubCodeCalc1": "Sleepovers - Sleepovers ///FAMILY ADVENTURES ////EARNED REVENUE", "DE:Name2": "Winter Wonderland Sleepover PDF for Registered Guests" } }, { "ID": "56421f7800549215c74830eeadc7d419", "name": "RP: DMN Arts & Life 1/31 (COL Now Open)", '______________________________________________________________________ Maybe I just need to know how to grab the fields that are within the parameterValues set? I have tried: rs![Element Format] = Thing.Item("parameterValues:DE:Element Format") rs![Element Format] = Thing.Item("DE:Element Format") rs![Element Format] = Thing.Item("parameterValues!DE:Element Format") Thank you in advance! I wish there was somewhere I could learn about the Thing.Item parameter!
@yvettethompson
@yvettethompson 8 жыл бұрын
+Yvette Thompson UPDATE: I had to assign it to an Object ( I don't know why it would not accept the Variant Dim) and then it worked: Set jsonParsedObj = Thing.Item("parameterValues") But how would I know that "keys" was a part of that? (jsonParsedObj.keys gave the variable names) Is there a book somewhere where I can look these things up? Does every Object have a "KEY"?
@ProgrammingMadeEZ
@ProgrammingMadeEZ 8 жыл бұрын
+Yvette Thompson I'm honestly not entirely understanding the problem. I think there are too many variables in your situation for me to fully grasp what you're doing and what your data is doing.
@yvettethompson
@yvettethompson 8 жыл бұрын
+Programming - Thank you for responding and I apologize for the "data dump". My problem in this comment was similar to my first problem I asked you a month ago. My API export comes with an Object Label at the beginning (Data) whereas your code in this video did not. A month ago the only way I could get your code to run was to remove that first "Data" label which I did with the Right() function on the Reader.ResponseText prior to running the Parse Code . I ask my API source for fields=parameterValues, resolvables. Resolvables is a nested collection and I could grab it. The parameterValues was not a collection, more like an array of values, and I had extreme difficulty finding anything to grab the data from it. Finally I set the parameterValues as an Object, and then I could extract its values using its "keys". But it was basically a blind pig finding an acorn as I was lucky to locate someone else's code that used that "key" information, or I would still be struggling to parse the fields from parameterValues. Initially, I tried to remove the "parameterValues {" label from the Reader.ResponseText before I used your Parse Code, (I tried to use the Replace() function but failed because I couldn't remove the parameterValue's closing french bracket "}" from the text). Anyway, I did solve the problem by learning to grab an array of values when you don't know the field (key) names. I appreciate your getting back to me and wish I knew more so I could communicate better. THANK YOU!
@snoble1978
@snoble1978 7 жыл бұрын
Ignore :) sorry i was on a secured connection that was blocking my access. I am good now.
38. (Advanced Programming In Access 2013) Using The Run Time Edition
23:50
Programming Made EZ
Рет қаралды 42 М.
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
34. (Advanced Programming In Access 2013) API’s, JSON, and XML
21:07
Programming Made EZ
Рет қаралды 18 М.
Five Ways to Stay Motivated To Code
11:03
Programming Made EZ
Рет қаралды 1,6 М.
30. (Advanced Programming In Access 2013) Writing To A Text File
17:00
Programming Made EZ
Рет қаралды 10 М.
26. (Advanced Programming In Access 2013) Send Outlook Email With VBA
22:40
Programming Made EZ
Рет қаралды 77 М.
12. (Advanced Programming In Access 2013) Using ADO Recordsets in VBA
24:02
Programming Made EZ
Рет қаралды 36 М.
25. (Advanced Programming In Access 2013) Adding Charts & Graphs To Forms
13:57