Formidable Forms

Formidable Forms

  • Features
  • Pricing
  • Resources
    • Docs & Support
    • Blog
    • Community
  • Solutions
    • Web Applications
    • Calculators
    • Surveys
    • Directories
    • Payments
    • Contact forms
  • Login
  • Get Formidable Forms

Set Values for Use in Views and Forms

Last Updated: April 28, 2020

Knowledge Base → Set Values for Use in Views and Forms

This shortcode allows you to set values, or parameters, that can be used within Views and forms. Once parameters are set using this shortcode, they can be used to filter Views, set default values within forms, and further customize form and View interactions.

Formidable Forms is the best WordPress Form Builder plugin. Get it for free!

Usage

In Pages or Posts

Insert the following shortcode before your form shortcode in a page or post.

[frm-set-get param_name="value"]

'param_name' = name of your new dynamic default value
'value' = value which will be retrieved with the get param shortcode

Insert the following shortcode in a field to retrieve the value of param_name.

[get param="param_name"]

'param' = name of the parameter that has been set in the url or shortcode
'default' = the value used if the value has not been set

In Views

This shortcode is most useful in a View. For example, if you are displaying an entry and would like to attach a contact form to send notifications to the email address attached to that entry, you could include something like this inside your View:

[frm-set-get contact_email="[26]"]
[formidable id=x]

'26' = ID of email field from Form A
'x' = ID of Form B (contact form)

Insert the dynamic default value in the email field in Form B:

[get param="contact_email"]

Additional options

Saving complex values as params

frm-set-get can be used to save complex values, which can then be used as parameters in other shortcodes, like frm-condition and Conditionals. Use param=param-name to set the param name of your choosing, and enclose your complex content inside the frm-set-get shortcode.

[frm-set-get param=total_cost][frm-stats id=100 type=total user_id=current][/frm-set-get]

This sets the total_cost param as the user's total for field 100.

[frm-condition source=frm-field-value field_id=72 user_id=current less_than=param param=total_cost]You've exceeded your monthly limit.[/frm-condition]

The frm-condition shortcode will display the message "You've exceeded your monthly limit" if the user's value in field 72 is less than the value of total_cost param.
Notes:

  • If frm-set-get is used inside a View, the parameter(s) it sets can't be retrieved inside the View using [get param].

    You can get around this on Gutenberg pages by using the [show_param] shortcode instead of [get param]. The code for the [show_param] shortcode is here:
    https://formidableforms.com/knowledgebase/php-examples/#kb-show-parameter-value-on-a-page.

    On pages created by the classic editor, you can put frm-set-get on the page above the View.

  • Because of the way shortcodes are processed in WordPress, having shortcodes with enclosed content (e.g. [frm-set-get param=insight]Formidable rocks![/frm-set-get] mixed in with shortcodes without enclosed content (e.g. [frm-set-get answer=42]) may not yield the desired results.
  • Usage
    • In Pages or Posts
    • In Views
  • Additional options
    • Saving complex values as params
Categories
×

Categories

  • Installation & Getting Started
  • Account Management
  • Forms
  • Entries
  • Views
  • Styles
  • Importing & Exporting
  • Add-Ons
  • Extend Formidable Forms

Using WordPress and want to get Formidable Forms for free?

Get Formidable Forms Lite Now

You do not have permission to view this form. Maybe you need to log in?

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

Take on bigger projects Right Now

Get the tools you need to revolutionize your workflow and architect a masterpiece. Build the most advanced WordPress forms and actually use the data you collect in meaningful ways.

Get the most advanced WordPress form plugin and the only form builder with integrated Views.

Get Formidable Forms Now

Resources

  • Community
  • Affiliates
  • Contact
  • Free Online Form Builder

Top Features

  • Application Builder
  • Calculator Forms
  • Surveys & Polls
  • Quiz Maker
  • Form Templates
  • Application Templates
  • Directories
  • Donation Plugin

Company

  • About Us
  • Giving Back
  • Careers
  • Newsletter
  • WP Tasty
  • Nutrifox

Copyright © 2023 Strategy11, LLC. Formidable FormsĀ® is a registered trademark Strategy11, LLC.
Privacy Policy | Terms of Service | Sitemap

Join 300,000+ using Formidable Forms to create form-focused solutions fast. Get Started See User Reviews