Tag: Filter

Problem:

We have a form that we use to collect entries. This is our “database” which has a view to display all of our entries. Not all entries are relevant to all users.

We want the user to be able to select which database entries are relevant to their business and be able to display them on their dashboard page.

Finally, we want the user to be able to go back to update or change their selections and for their previous selections to still be there. 

Solution:

We created a second form with a user id field and a dynamic field (checkboxes) that holds all of the titles of each entry in our database. The user will use this form to make their selections. Now we create a view from that form which we will call “Dynamic Selection”. In the content section of this view we write “[3696 show=id],” // change 3696 to your dynamic field. (Make sure the comma is there after the closing bracket). Now we’ll add the standard “User ID = current_user” filter along with sorting by “Entry Creation Date =  Descending”. Finally, set the “limit = 1”. Now we have a view that has our most recent entry ID for the current user.

After everything is set up correctly, copy the view shortcode and go back to the database view (first form’s view). Here we will add the filter “Entry ID = [display-frm-data id=17347]” // paste your own view shortcode. Now we have a dynamic field being used to filter the databases entries based on the checkboxes that are selected for that current user. 

Now for the final part, we are simply going to take our entry ID shortcode and paste it into the default value of the field in the Dynamic Field. This will make it so our checkboxes are always prepopulated with the user’s last selection.

×Warning: This tutorial was created 2039 days ago. Some of the information may be out of date with more recent versions of Formidable. Please proceed with caution and always perform a backup before adding custom code.

The default shortcode for a view is

[display-frm-data id=172 filter=limited]

Here "filter" refers to the WordPress filter function NOT the Formidable Forms filter function.

To stop this behaviour remove or zero the filter term.

[display-frm-data id=172 filter=0] OR [display-frm-data id=172]

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