Introduction

The latest How To topics are available in the K2 Five User Guide or the K2 Cloud User Guide’s How to section.

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.

Implementation Details
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.

Image


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.
Image

Example Scenario
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:

  1. Create the following SmartObjects:
    Image
    Image
  2. Generate a Products Editable List View:
    Image
  3. Now create a Customer Item View, drag a Button control onto the canvas and rename the control and Text to be displayed.
    Image
  4. 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.
    Image
  5. Click Finish to save the View.
  6. Generate a K2 Customer Form from the K2 Customer Item View.
  7. Edit the K2 Customer Form and drag the Products Editable List View onto the canvas as shown below.
    Image
  8. Click on the Rules step and add the following Rule:
    Image
  9. 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.
    Image
  10. Click Finish to save the Form.
  11. Run the Products Editable List View and capture some data.
  12. Run the K2 Customer Form.
  13. The user can select a Product and can navigate to the URL by clicking on the Button as shown below.
    Image
  14. 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.
    Image