
Data Source for Contact Form 7 plugin allows populating the “Contact Form 7” fields (text, email, URL, drop-down menu, …) with data stored in external data sources, like a database, CSV file, URL parameters, users information, post data, taxonomies, Advanced Custom Fields (ACF), and JSON objects.
Data Source for Contact Form 7 includes two new controls in the controls bar of Contact Form 7, recordset and recordset field link. The “recordset” control reads the information from the external data source (a database, a CSV file, or any other data source supported), and the “recordset field link” control for linking the recordsets and form fields to populate them with the recordset data.
A form can include several “recordset” fields, and it is possible to link multiple “recordset field link” controls to the same recordset.
How to create the simplest contact form from our practical examples.
The plugin includes other complementary controls in the controls bar in addition to the “recordset” and “recordset field link”. The “Print Form” button for printing the form area, “Data Table” control for inserting an advanced table with the recordset records, “copy to clipboard” functionality for copying the values of the fields into the clipboard, and the “Search box in dropdown menu” functionality to make easy the selection in long dropdown menus.
Data Source for Contact Form 7 includes two new controls in the controls bar of Contact Form 7, recordset and recordset field link.
The recordset control reads the information from the external data source and makes it available on the form. A recordset field can read one or many records from the data source.
To insert a recordset field in the form, press the “recordset” button in the controls bar. This action opens a dialog to define the recordset.
The insertion dialog includes common attributes for all data sources and specific attributes for the data source selected.
The “recordset field link” control links a recordset field to other fields in the form to populate them with the recordset data.
To insert a link field in the form, press the “recordset field link” button in the controls bar. This action opens a dialog to define the relationship between a recordset and a form’s field.
The link dialog includes the attributes to define the relationship between the recordset field and the form’s fields.
Get the information of the registered user and populate the form fields for his name and email:
<label> Your name [text* your-name] </label> <label> Your email [email* your-email] </label> <label> Subject [text* your-subject] </label> <label> Your message (optional) [textarea your-message] </label> [cf7-recordset id="cf7-recordset-434" type="user" attributes="first_name, user_email" logged="1"] [cf7-link-field recordset="cf7-recordset-434" field="your-name" value="first_name"] [cf7-link-field recordset="cf7-recordset-434" field="your-email" value="user_email"] [submit "Submit"]
Filling a plain text in the form with the first name and last name of the logged user:
<label> Hello <span id="first-name"></span> <span id="last-name"></span></label> <label> Enter your address [textarea address] </label> [cf7-recordset id="cf7-recordset-434" type="user" attributes="first_name, last_name" logged="1"] [cf7-link-field recordset="cf7-recordset-434" field="first-name" value="first_name"] [cf7-link-field recordset="cf7-recordset-434" field="last-name" value="last_name"] [submit "Submit"]
Populates the list of WooCommerce products and get the price of the selected one:
<label>Products List [select menu-719]</label> <label>Product Price [number number-534]</label> [cf7-recordset id="cf7-recordset-619" type="database" engine="mysql" query="SELECT ID,post_title,meta_value as price FROM {wpdb.posts} posts, {wpdb.postmeta} meta WHERE posts.post_type='product' AND posts.ID=meta.post_id AND meta.meta_key='_regular_price'"] [cf7-link-field recordset="cf7-recordset-619" field="menu-719" value="ID" text="post_title"] [cf7-link-field recordset="cf7-recordset-619" field="number-534" value="price" condition="record['ID']=={field.menu-719}"] [submit "Submit"] Using templates to create complex data structures. Displaying the title and excerpt of every published post:
<div id="posts-list"></div> <template id="summary"> <p style="font-style:bold">{attribute.post_title}</p> <p>{attribute.post_excerpt}</p> </template> [cf7-recordset id="cf7-posts" type="post" attributes="post_title,post_excerpt" condition="post_status='publish' AND post_type='post'"] [cf7-link-field recordset="cf7-posts" field="posts-list" value="{template.summary}"] The form includes a template tag to design a complex data structure. To access the records attributes from the template, use {attribute.attribute-name} format. Ex. {attribute.post_title}
You can use the templates for the fields’ values or texts. The format for referring to templates is {template.template-id}. You should replace “template-id” with the id of the template tag. Ex. {template.summary}
[cf7-link-field recordset="cf7-posts" field="posts-list" value="{template.summary}"] The recordset fields trigger the “cf7-recordset” event after receiving the information from the data source, allowing you to access this information with Javascript. In this example, the recordset field reads motivational phrases from a third-party service and displays the first of them into a DIV tag on the form.
Starting from $0 per month.
Rating
Reviewers
9 reviews
Tags
Developed By
codepeople
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Contact Form plugins for Wordpress
Maps plugins for Wordpress
Translation plugins for Wordpress
Chat plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Contact plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Forms plugins for Wordpress
Comments plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Comments plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Portfolio plugins for Wordpress
Video Player plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Inventory plugins for Wordpress
Testimonials plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Analytics plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Security plugins for Wordpress
Ads plugins for Wordpress
Music Player plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Membership plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Video Player plugins for Wordpress
Tabs plugins for Wordpress
Social Feeds plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Add customizable content cards to your site to display structured information clearly with flexible layout and design options.
Use an order form to let customers submit product orders, save entries, receive notifications, and collect payments through PayPal or Stripe for a smoother buying experience.
Show Threads posts in a live feed that keeps content fresh, builds social proof, and helps visitors engage on your site.
Use event flip cards to highlight upcoming activities, improve visibility, and help visitors discover events that increase attendance and engagement.
Show LinkedIn posts in a live feed that keeps updates current, builds credibility, and helps visitors engage with your brand.
Collect candidate information with a job application form that organizes submissions, streamlines hiring, and helps you manage applicants efficiently.
Use a reviews badge to highlight your ratings, build trust at a glance, improve credibility, and help increase conversions across your site.
Add a no-code music player to your site to stream audio, share playlists, and support multiple formats with easy setup.
Display and manage customer reviews from multiple platforms in one place to build trust and highlight brand credibility.
Create interactive flash cards that present questions and answers in a clear, customizable format to support learning, training, and user engagement.
Manage appointments with an appointment booking widget that lets visitors schedule easily, syncs calendars, sends reminders, and creates a smoother booking experience.
Bracket generator for creating interactive tournaments that organize matchups, track progress, and deliver a clear and engaging competition experience.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
