AX1293
GetFormState function
Returns the value of a given form state key that is held in form state memory for the current file.
This function is only for use in configurations where an Axiom form is being used as a dialog or task pane in the Excel Client or Windows Client, and you want to pass form state values from the Axiom form to the active spreadsheet file.
Syntax
GetFormState("FormStateKey", "DefaultValue")
Parameter | Description |
---|---|
FormStateKey |
The key name of a particular form state value that you want to return. For example, if an Axiom form component has been configured with |
DefaultValue |
The text to be used as the default form state value for the designated key if no value has yet been set by Apply Form State. Technically, this does not set the actual form state value to the default value. You can change the default value within the function, and the function will continue to return the latest default value until an actual value is set by a form. Once the actual form state value has been set, then the default value is ignored and the function will not respond to any future changes to this parameter during the current file session. When the file is closed, the actual form state values are cleared and the default values will again be used the next time the file is opened. |
All non-numeric entries must be placed in double quotation marks, unless you are using cell references to reference the text held in another cell.
Remarks
-
When an Axiom form dialog or task pane is opened, all form state values from the currently active spreadsheet (whether default values or actual values) are passed into the Axiom form. These values override any default values set in the Axiom form.
-
When using the GetFormState function to set a default value, make sure that the file only contains one function with a default value for each form state key. If multiple default values are set for a single form state key within a file, then the default value will be taken from the last function that happens to be evaluated when the sheet is calculated.
-
GetFormState is a volatile function.
Examples
=GetFormState("VPName")
This example returns the value of the form state key VPName—for example: Jones. If no value has yet been set for this form state key, the function will return blank.
=GetFormState("VPName","Smith")
This example is the same as the first example, except that if no value has yet been set for VPName, then the default value will be set to Smith and the function will return Smith. If a form subsequently sets the actual value to Jones, then the function will return Jones and the default value is ignored.