Okay
  Public Ticket #3643563
nested json
Closed

Comments

  • Edwin Dabbaghyan started the conversation

    Hello

    Please see the attached screenshot. I have a nested json url, how can I get all the data for all nods at the same time? Or do I have to get data for every root individually? This would take a lot of time and work, can't I get all the data at once with on the first root? In this case, all exists in the root -> response

    2579091578.png


  •  1,819
    Miloš replied

    Hello,

    Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.


    As our developers pointed out in this example on our Documentation,

    if we only choose up to the first level deep in the JSON roots, such as "root>results",

    then it works without any additional step needed.

    4328952292.png

    There is this part of the Documentation beneath the example, where our devs stated :

    Please note: The root path that is chosen, needs to have the same object with the same keys and values as you can see for chosen path “root->results”. 

    If values are not a string, then those values will be skipped by default.

     In this case keys “films”, “vehicles”, “starships”, and “species” have values as arrays (in some cases they can be objects) and they will not be shown. 

    If you need to show data from those arrays as well, there is an option with a hook.

    So, when one of the chosen root path objects contains keys that have an array or objects as values

     and you need to include them in a table as cell values, then you can choose these two hooks:

    • wpdatatables_get_one_level_deep_json_data_from_array_as_string and
    • wpdatatables_set_one_level_deep_json_data_separator

    Please check more details explained about this on this Documentation Page,

    find the title as "Use hooks to parse one more level deep in root path".

    4754281349.png

    There you will find the detailed explanation how you can use this hook to access one more leel deep in your JSON root path.

    Please note that using hooks requires certain level of programming skills and included support refers only to advice.

    I hope this helps.



    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    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