Advice for newbie on storing information and mapping to Formidable Forms

By: Jamie Robe | Asked: 01/10/2023
ForumsCategory: General questionsAdvice for newbie on storing information and mapping to Formidable Forms
Jamie Robe asked 2 years ago
Hi everyone, long time wp user and coder too. But just starting out on Formidable Forms. Loving what I see so far.  I am a bit confused on best approach for me.  I want to be able to use this plugin to build forms and tables, etc for custom post types (CPT).  I usually either make the CPT in a plugin and/or have also used PODS. I want to move away from PODS. In this plugin, do I need to build the underlying CPT first (in code or with a tool like Custom Post Type UI ) or does Formidable Forms make them for me? Also, on rare occasions I also want to store data in just a plain totally custom mysql DB table.  If I have such tables, can I map Formidable Forms to them too or does it just work with posts?    
Question Tags:
Bobby Clapp replied 2 years ago

I recommend first building your custom post type in a CPT tool. I prefer Custom Post Type UI. Then using the form to post form action, you can push form data to a post (the previously created CPT using CPT UI) . You can use the following hook to push data to someplace else:

https://formidableforms.com/knowledgebase/frm_after_create_entry/#kb-insert-form-data-into-second-database-table

Jamie Robe replied 2 years ago

Thanks Bobby. That code looks good.

1 Answers
Victor Font answered 2 years ago
Formidable doesn't build custom post types. You need to create the CPT yourself with code or using a plugin like CPT UI. What I love about about Formidable's CPT integration is that you don't have to pass any field content to a CPT. Formidable links the CPT to an entry's header record. To display Formidable data in a CPT, I create a single_{cpt-slug}, setup whatever parameters I need by passing the CPT id to Formidable, and display entry data in a view. You can see how this works on Formidable Masterminds. Every published post attributes it content to its author and provides contact details about the author in Formidable views with data supplied from the Developers Directory. Every registrant in the Developers Directory also has a developer CPT displaying their Developers Directory entry record. Many of the familiar names that answer questions on this site are listed in the developers directory. For example, here's Rob Levine's CPT: https://formidable-masterminds.com/developer/rob-levine/. I'll answer the second part in the comment. The HTML processing for these answers is buggy.
Victor Font replied 2 years ago

As for the second part of your question about tables, you can use Formidable with any table structure you want because you're using WordPress for DB interactions that don't pertain to Formidable's schema directly. Formidable follows the WordPress meta_data design. This works great as a transactional system, but when forms get long, reporting with complex views can hinder performance because of the complexity of the SQL the system generates. I've even connected Formidable to Microsoft SQL Server databases through ODBC. With PHP, we have access to low level functions that allow us to do so.

The Formidable Masterminds Codex has a lot of detail if you're looking for hooks. Formidable is loaded with developer hooks. There's even one that allows you to write your own SQL before processing view content. This means you can build views with data sourced from Formidable's tables, SQL Views, or even normalized or star schema data structures if an ODS is required for reports and metrics.

I've been using Formidable for website builds since Version 1 or 2. My background is enterprise software engineering. I am the author of "The Ultimate Guide to the SDLC". SDLC means System Development Life Cycle. As a product, Formidable is as good as any enterprise development toolset that I've seen. I've worked on some very big projects for various U.S. Federal Government agencies and State Universities where Formidable Forms is the backbone of their processes for both public web and intranet. Formidable is a developers tool that will stand up against any challenge your development projects require.

Jamie Robe replied 2 years ago

Thank you Victor for the detailed info. I can't believe I had never heard of Formidable Forms before. I have built some apps using PODS but this actually seems to me to have a lot more features and use cases. I am checking our your Mastermind site as well. Thanks again 🙂
Jamie

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