Skip to main content
Version: Next

Set Navigation Route 2

Updates the URL state with 2 'key-value' pairs

Description

Allows to update or add 2 key-value pairs in the URL state, thereby modifying the route
If the provided keys already exist in the state, the brick will replace the existing values with the new ones. However, if the key is not found in the state, the function will insert the key-value pair into the URL.

The brick also pushes a new navigation state.

Examples:

  1. state: tab=first<ol>
  • key1: menu
  • value1: demand
  • key2: category
  • value2: contracts</ol> Pushed state: tab=first;menu=demand;category=contracts
  1. state: tab=first<ol>
  • key1: menu
  • value1: balance
  • key2: category
  • value2: models</ol> Pushed state: tab=first;menu=balance;category=models

Inputs

  • Control Flow (Control Flow)
  • key 1 (String): A string representing the key to be inserted or updated in the state. This key specifies the location in the URL where the value will be placed or modified. For example, in the state "menu=demand;tab=first", "menu" is a possible key.
  • value 1 (String): Represents the value associated with the provided key. This value will be inserted or updated in the URL state according to the given key. For instance, if the key is "menu" and the value is "balance", the state will be modified to "menu=balance;tab=first".
  • key 2 (String): Represents the key to be inserted or updated in the state. This key specifies the location in the URL where the value will be placed or modified. For example, in the state "menu=demand;tab=first", "tab" is a possible key.
  • value 2 (String): Represents the value associated with the provided key. This value will be inserted or updated in the URL state according to the given key. For instance, if the key is "tab" and the value is "first", the state will be modified to "menu=balance;tab=first".

Outputs

  • Control Flow (Control Flow)