Okay
  Public Ticket #3003793
Displaying a returned csv or json table from an external API call via wbDataTables
Closed

Comments

  • Mohammed started the conversation

    I have a short code that calls an external API via a GET call and returns a csv or json formatted table response. How I can capture that data and override the data only (not the table headers) in an exiting wbDataTable and display the refreshed table via wbDataTable Short Code?

  •  1,846
    Miloš replied

    Hi, Mohammed

    Thanks for showing interest in wpDataTables

    - Sorry if I didn't understand everything correctly, please correct me if that's the case.

    Basically, you can get a CSV or JSON formatted response as the result, and you would like to see how it can be implemented into an existing wpDataTable?

    -

    This depends on what type of table you would be using to update it.

    If you link a table to the source data, during table creation, such as JSON or CSV, and if you update/edit the source, the output table would stay synchronized/linked with it.

    1. If you use JSON format, important note :

    When working with JSON format please note: Currently, wpDataTables accepts this, and only this, format of JSON (see example): a one-level array of same-structured objects where each object will be parsed as a row, and each field inside of the object as a cell. If your software does not return this format, you would need to prepare, as an example some PHP adapter to return one of the formats that wpDataTables would accept.

    More details here.

    2. Regarding linking a table to a CSV file, please check out this documentation with an example.

    -

    Let me know how that sounds, and if you have further questions.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables