Title: Variable as Predifined Value
Last modified: August 27, 2020

---

# Variable as Predifined Value

 *  Resolved [escribbles](https://wordpress.org/support/users/escribbles/)
 * (@escribbles)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/variable-as-predifined-value/)
 * Is it possible to use a variable as a predefined value in a calculated field?
 * I am trying to make 1 calculator for multiple pages and would like to just use
   a variable on the page to insert the predefined value into the calculator to 
   save considerable time. Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/variable-as-predifined-value/#post-13323054)
 * Hello [@escribbles](https://wordpress.org/support/users/escribbles/)
 * You can insert a shortcode for the variable in the page’s content to define the
   new variable, for example:
 *     ```
       [CP_CALCULATED_FIELDS_VAR name="varname" value="myvalue"]
       ```
   
 * and then, you can use this variable in the equations associated with the calculated
   fields in the form, for example: `varname*2`
 * Best regards.
 *  Thread Starter [escribbles](https://wordpress.org/support/users/escribbles/)
 * (@escribbles)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/variable-as-predifined-value/#post-13323095)
 * Yeah, the problem is I only want the variable as the predefined value of the 
   calculated field. I would like to have another equation in there that changes
   dynamically with another editable calculated field.
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/variable-as-predifined-value/#post-13323127)
 * Hello [@escribbles](https://wordpress.org/support/users/escribbles/)
 * The code depends on the equation. I’ll try to describe it with a hypothetical
   example.
 * Assuming you have the equation: `fieldname1+fieldname2`, and you want to display
   the value of the variable while are not entered the values of these variables.
 * The equation in this hypothetical case should be edited as follows:
 *     ```
       IF(OR(fieldname1,fieldname2), fieldname1+fieldname2, varname)
       ```
   
 * Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Variable as Predifined Value’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/variable-as-predifined-value/#post-13323127)
 * Status: resolved