Sql View

By: Bob Webb | Asked: 02/23/2024
ForumsCategory: How-toSql View
Bob Webb asked 4 months ago
I'm struggling to create a view to display what I want but I can do it in MySQL. Is there a way to get Formidable to display the result from a query? If not can someone give me a pointer on how to replicate the query (edited to be acceptable for entry) below with the view builder?  YEAR(`created_at`), WEEKOFYEAR(`created_at`), sum(`meta_value`) FROM `frm_item_metas`
where `item_id` in (my selection criteris)
and `field_id` = 52
Group by YEAR, WEEKOFYEAR   Thanks in advance.
1 Answers
Victor Font answered 4 months ago
Yes. You can do this with the frm_view_order filter. It’s the only filter in Formidable where you can use a custom query with a view. The query needs to return a list of entry ids that meet the search criteria and the view will process the results accordingly. This is the topic of my next Developers Series book. I’ll be teaching how to open the entire RDBMS to Formidable. 
Bob Webb replied 3 months ago

<p>Thanks Victor - for some reason I didn't get a notice about your response so please excuse my tardiness. I'll look into this and, almost inevitably, come back to you. Where can I get notice of your forth coming publication? _ </p><h1 class="entry-title">The Masterminds Store?</h1>

Victor Font replied 3 months ago

I publish announcements about book a column releases in my Formidable Masterminds Facebook Group. Please feel free to join. https://www.facebook.com/groups/formidablemasterminds

Victor Font replied 3 months ago

Also, when you use custom SQL or SQL views with frm_view_order, all you need to do is return a list of matching entry ids.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right