Page tree
Skip to end of metadata
Go to start of metadata

There are two types of values that you can assign to an Input Field component: Default Value and Runtime Value.

Default Value

If you assign Default Value to an Input Field component, once a user starts the form component's input field will be pre-filled with the value you have assigned. It will happen only once, on form instantiation. 

You can set Default Value as a text, through Javascript calculation or as Webservice call. 

To assign Default Value to an Input Field component as a text:

  1. Open your form in the Visual DesignerIn the drop-down list ("Selected item") at the top of the Display Panel find and select the page on which the Input Field component you want to assign Default Value to is located.



  2. On the page find the Input Field component you want to assign Default Value to and click on it. The component is now highlighted and its settings are displayed in the Properties panel. 



  3.  In the Properties panel click on "More Settings..." link and then select "Default Value settings" 






    If you already have Default Settings assigned, use "Modify" button in the section that states "Field has default value (...)".  


  4. In the Editor window that will open, select Text in the "Value Assignment Type" drop-down list and in the "Text Value" box type the text you want to assign to the Input Field component on form instantiation. Save your changes. 




    In the Properties panel there is now a section with "Field has default value (constant)" label and two buttons: "Modify" button that will open the Editor again and "Delete" button that allows you to remove Default Value assignment.

  5. Commit your changes by clicking on "Commit" button in Controls panel and then click "Preview Form" button to check that the field is populated with value you assigned.


See Default Value Settings for more details

Go to  Default Values Example to see Default Value in action.

Runtime Value

You assign Runtime Value to a component when, instead of accepting user entries, you want to calculate its value based on entries/choices the user makes in other components as he/she fills in the form. Runtime calculation is triggered and value is assigned to the component every time there is a change of value in these other (referenced) component/s. 

You can set Runtime Value through Javascript calculation or as Webservice call, both methods will be based on the values of the referenced component/s. 

To assign Runtime Value to an Input Field component through Javascript calculation:

  1. Open your form in the Visual Designer. In the drop-down list ("Selected item") at the top of the Display Panel find and select the page on which the Input Field component you want to assign Runtime Value to.

  2. On the page find the Input Field component you want to assign Runtime Value to and click on it. The component is now highlighted and its settings are displayed in the Properties panel. 



  3.  In the Properties panel click on "More Settings..." link and then select "Runtime Value Calculation" 




    If you already have Runtime Value Calculation assigned, use "Modify" button in the section that states "Field has runtime-calculated value (...)"


  4. In the Editor window that will open, select "From Javascript" in the "Value Assignment Type" drop-down list and in the "Source code" box, type the Javascript code that will calculate return value based on the referenced components. This value will be assigned to the Input Field component every time the value/s of referenced components are changed. Access to the referenced component in the code is done by using $field[field_name] notation, where field_name is the Field Name setting of the referenced component.



    In the Properties panel there is now a section with "Field has runtime-calculated value (javascript)" label and two buttons: "Modify" button will open the Editor again and "Delete" button allows you to remove Runtime Value assignment.

    In this example, the Text Field component with the Field Name "amount" is referencing the Radio Field component with Field Name "package.size" whose options defined as follows: 


  5. Commit your changes by clicking on "Commit" button in Controls panel and then click "Preview Form" button to test that the assignment works. Select different package size, and see how the amount is changing.


For more details see Runtime Value Calculation.

Go to  Runtime Values Example to see Runtime Value in action.


  • No labels