Skip Navigation

[Resolved] Get Views output as JSON

This thread is resolved. Here is a description of the problem and solution.

Problem:
Can Views be used to output a valid JSON string?

Solution:
No, not a native way.

What you can do is applay a Custom Filter to render a raw View's Loop.
Then, in the Loop, you can use JSON format.

This is the function you need:
https://toolset.com/forums/topic/views-not-working-after-installing-v1-11/#post-345294

One more for reference:
https://toolset.com/forums/topic/error-using-cred_generic_field-to-let-user-select-the-post-author/#post-346275

A user also acheived this by another Plugin:
https://wordpress.org/plugins/views-output-formats/

This support ticket is created 7 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 2 replies, has 2 voices.

Last updated by Hector 7 years, 7 months ago.

Assisted by: Beda.

Author
Posts
#424717

Hi,

Is there a way to output Views as JSON? I see there is a question in this forum asking this same question in 2013, has it become available since then?

Many thanks

#424738

No, not a native way.

What you can do is applay a Custom Filter to render a raw View's Loop.
Then, in the Loop, you can use JSON format.

This is the function you need:
https://toolset.com/forums/topic/views-not-working-after-installing-v1-11/#post-345294

One more for reference:
https://toolset.com/forums/topic/error-using-cred_generic_field-to-let-user-select-the-post-author/#post-346275

Let me know if I can help you with other Toolset Supported Features.

#425132

Thanks Beda.

I found this plugin which seems to do the trick:

https://wordpress.org/plugins/views-output-formats/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.