Get Navigation Route
Allow to obtain the related value assosiated with the provided key from the state (URL)
Description
The brick is designed to retrieve a specific value from the state (URL) based on a given key. It allows you to navigate through the URL state and obtain the corresponding value associated with the provided key. In case the key is not found in the state, the function returns the default value instead.
Examples:
-
State (URL): menu=demand;tab=first Key: menu Default: balance Output: demand
-
State (URL): menu=demand;tab=first Key: category Default: balance Output: balance
Inputs
- key (String): A string representing the key to search for in the state. It specifies the desired information to be retrieved from the URL. For example, in the state "menu=demand;tab=first", "menu" is a possible key
- default (String): A string representing the default value to be returned if the provided key is not found in the state. This value acts as a fallback option when the requested key is unavailable.
Outputs
- value (String): A value associated with the provided key in the URL state. The output can be one of two possibilities:
Key Found: If the provided key is present in the state, the function returns the corresponding value associated with that key. For example, if the state is "menu=demand;tab=first" and the key is "menu", the output will be "demand".
Key Not Found: If the provided key is not found in the state, the function returns the default value. Using the same example, if the key is "category" (which is not present in the state), the output will be the default value.