​​How to set the value of a field on the form to what is entered in the form URL parameter?

Last Update: November 20, 2017

Using the below steps, you can test whether a specific parameter is presented in the URL or not. In our case we will get the value for "Language" parameter and set it to a TextBox control. Here are the steps on how to do that:

  1. Open the form in design mode.
  2. Add a TextBox control and name it "txtURLValue".
  3. Click on an empty space in the form.
  4. Expand the Form Rules pane in order to add a form rule.
  5. In the Rules pane, click on the Add icon to add a new rule, the Rule Manager dialog will open.
    How to auto-shifting Panel control in a form2.jpg
  6. Add a new rule at Date1 control as follows:
    A. Change the Rule Name as desired.
    B. Change the Rule Type to Action.
    C. Change the Event Type onLoad.
    D. In the Condition section, type the following:
          getFormQueryString('Language') != null
    E. In the Action section, type one of the following script:
        a. setValue(txtURLValue, getFormQueryString('Language')!= null? getFormQueryString('Language'): '')
        b. try{
            setValue(txtURLValue, getFormQueryString('Language'))
              }catch(ev){}
    F. Click on the Save button to save the rule.
    Note: You can use Assistance Panel to help you adding functions and related parameters, form variables and form controls to Conditions and/or Actions sections.
  7. Test the form by clicking on the Preview button in the View group.