The Field Updater Addon lets you dynamically update your form fields and display related content on your website. In this guide, we’ll walk you through three popular use cases:
Displaying Related Posts
Displaying Related Categories
Displaying Posts from a Selected Category
For all these use cases, make sure you have installed the addon from the GitHub repository:
Addon URL: jet-form-builder-update-field
1. How to Display Related Posts
This example shows you how to display posts related to a selected custom post type (CPT) item.
Steps:
Install the Addon
Download and install the Field Updater Addon as you would any other WordPress plugin.
Create a Posts Query for Your CPT
Set up a Query for your CPT where you want to display related posts.
Select the appropriate macros for your related items.
Note: The query variable should be named
jfb_update_related_select
(replaceselect
with the name of your first Select form field).
Create a Dynamic Select Field
In your form, add a new Select field and choose the new query you just created.
Enable the Generate Dynamically option.
Below, select Get values list from JetEngine Query.
Replace the number (e.g.,
284
) in the Field name section with your query ID (find it in the URL of the query).Enable the Field Updater option and enter the first select form field’s name in the Fields to Listen section.
2. How to Display Related Categories
This example explains how to dynamically display child categories based on a selected parent category.
Steps:
Download and Install the Field Updater Addon.
Create a Query for the Parent Category
Create a Terms Query that lists the parent categories.
Add a Select Field for Parent Categories
Create a Query for the Child Category
Add a Select Field for Child Categories
3. How to Display Posts from a Selected Category
This example demonstrates how to list posts that belong to a selected category using the Field Updater Addon.
Steps:
Install the Addon
As usual, install the Field Updater Addon.
Create a Terms Query for the Category
Create terms query that fetches the terms for your desired category.
Add a Select Field for Categories
Create a CPT Query for Your Posts
Create posts query to list posts from your selected category.
In the Terms section of the query, select the Form Field Value macro and enter the form field name that holds your category terms.
Add a Select Field for the Posts
Additional Information
For more details and advanced configurations, please check out the following resources:
Addon Explanation: GitHub Page
Our Blog Guide: Update JetFormBuilder Fields Dynamically
YouTube Video Tutorial:
Learn How to Use Selective Data from REST API Endpoints with JetFormBuilder