• Resolved peniaman

    (@peniaman)


    Hi there. I love how the plugin works so far I’t has speed. However I’m having a bit of an issue with a JSON I NEED to work with for a project. This is an example of the url I get from the company: https://securea.mlb.com/lookup/json/named.wbc_standings_qual.bam?season=2013.1
    the contained JSON works fine for a site such as https://json2table.com/ and it makes a nice table. However I would’ve loved to use your plugin and maybe “skip” some fields on the final table. All I need is a 6 column table out of the data in the JSON however programming is not my forté at the moment. The idea is if these people change/update the data it will be reflected on the site I’m building.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I’m afraid that I’ll have to disappoint you here. This JSON format is too complex for TablePress to handle at the moment. ??
    The plugin only supports tables that are formatted as two-dimensional arrays in JSON. It does not understand such object notation.
    In order to import this data, you’d for example need to write a PHP script that works as an interface: It loads the JSON from that URL and converts it to something that TablePress understands. Then, you can use the URL of your PHP script for the import.

    Regards,
    Tobias

    Thread Starter peniaman

    (@peniaman)

    Ow… bummer… that does sound like a plan… now lets see if I can pull that off I’m a bit rusty (ok, more than a bit). Thanks for the answer though ??

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    it shouldn’t be too difficult.
    You’ll probably just need file_get_contents(), json_decode(), some array/object shuffling, and then json_encode() again.

    Regards,
    Tobias

    Hello @tobiasbg

    Can you post an example of json format that datatable can read?

    I have the same question.

    Thanks!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    any two-dimensional array will work, like

    [["Cell 1","Cell 2","Cell 3","Cell 4"],["Cell 5","Cell 6","Cell 7","Cell 8"],["Cell 9","Cell 10","Cell 11","Cell 12"]]
    

    Regards,
    Tobias

    hi, i read them but i had have this problem yet.
    when i copy paste json file in manually import is working correctly but when i use url link i have an error : “tablepress import Error The source for the import could not be accessed.”
    ssl is active and the link is public
    please help me

    pls give me a sample of url json for importing
    my file is :
    [ { “Hdir”: “E/W”, “Vdir”: “N/S”, “Floor”: null , “Building”: “???????”, “Perfix”: “?????”, “Fname”: “???”, “Lname”: “??? ????????”, “Job Title”: “????”, “Mitel”: “Mitel”, “Panasonic”: “4838”, “Fax”: “???”, “Email”: “?????” }, { “Hdir”: null, “Vdir”: null, “Floor”: 4.0, “Building”: 6.0, “Perfix”: “????”, “Fname”: “????”, “Lname”: “???”, “Job Title”: “?????? ???? ???????”, “Mitel”: 1234, “Panasonic”: null, “Fax”: null, “Email”: “?????” }, { “Hdir”: null, “Vdir”: null, “Floor”: 4.0, “Building”: 6.0, “Perfix”: “????”, “Fname”: “????”, “Lname”: “?????”, “Job Title”: “???????? ???? ???????”, “Mitel”: 2345, “Panasonic”: null, “Fax”: null, “Email”: “Nader.Rezaei” } ]

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    what’s the URL that you were using?

    Regards,
    Tobias

    https://webservice.mahan.aero/OfficeContactJSON.aspx
    in our database server.
    it is working correctly when i use it as a manually or file upload but as url doesn’t working pls help me it’s very important for me

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the link! Now, is this really a publicly reachable URL? I, for example, can not access it. I only get the error that the DNS request to that domain failed (i.e. my browser was not able to get the IP address).
    Is this domain maybe only configurd in your local network?

    That would explain things, because the server with TablePress on it then has the same problem.

    Regards,
    Tobias

    thanks ,
    yes , It’s a local network.
    i would like to work on a local server

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    you can do that, but only if the server that WordPress is running on can access that server. I assume that that is the problem here.

    Regards,
    Tobias

    ok how to do it? pls help me
    and i have a question more:
    i have a excel file in local server , i would like to use this as automatically,does this file load automatically update in may page?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    you will have to make sure that the server where WordPress/TablePress is running on can access the server that serves your JSON API.

    If that is the cause, you can use the Auto Import feature of the TablePress Extension.

    Regards,
    Tobias

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Tablepress json url import not working for me’ is closed to new replies.