Changes have been made to this Action to allow for a dynamic URL to be set and parameters to be added to the query string. The option to open the URL through different types of windows is also now available. This Knowledge Base article describes how to use this new feature.
In the Rule Action to "navigate to a URL", new options have been added to the configuration. After adding the Rule Action, click on (configure) to set dynamic URL properties.
You can set the Base URL, as well as adding parameters. Any of the properties can be hard coded (or typed in), or dynamic by using values from the Context Browser. In addition to the parameters, you can also set whether the Navigate to a URL action will open the link in a new window or the existing window or tab. This value will use the user's browser's default value. For example, if the browser is set to use tabs instead of windows, the Rule Action will honor that browser setting.
In this scenario we are using an example where the Customer will complete a Form and select the Product. Next to the Product is a Button that can be clicked and it will take the user to a Press release of K2 smartforms should the user wish to read it. When clicking on the button, a new window will open using the URL query string specified in the Rule. Follow the steps below to set up the scenario as described above:
- Create the following SmartObjects:
- Generate a Products Editable List View:
- Now create a Customer Item View, drag a Button control onto the canvas and rename the control and Text to be displayed.
- Click on the Product control, change the control to a Drop-Down List and specify the Products SmartObject as the data source as shown below. Select the Create control and change the name and text to Submit.
- Click Finish to save the View.
- Generate a K2 Customer Form from the K2 Customer Item View.
- Edit the K2 Customer Form and drag the Products Editable List View onto the canvas as shown below.
- Click on the Rules step and add the following Rule:
- Click on configure next to the navigate to URL Action, then complete the details as shown below. Select the New window (or tab) option. Click OK and Finish to save the Rule.
- Click Finish to save the Form.
- Run the Products Editable List View and capture some data.
- Run the K2 Customer Form.
- The user can select a Product and can navigate to the URL by clicking on the Button as shown below.
- The URL opens in a new window and the user is able to read the Press release. Note the URL at the top of the window.