How to pass url parameters out of order

Guys, does anyone know how to pass url parameters out of order?

Examples

/cars/key1=value1&key2=value2&key3=value3
or
/cars/key3=value3&key1=value1&key2=value2
or
/cars/key2=value2&key3=value3&key1=value1

I need to send these parameters out of order, how do I retrieve and assemble the routes?

Hi Juliano and Welcome to the community!
Can you explain a little more what you want to achieve?
You can use the query manager in order to handle parameters, like:
image


image
image

wp

I need to pass the parameters without depending on the previous ones, I need to pass the key3 parameter without having to pass the key2 parameter.

Example

/cars/key1/key2/key3

/cars/key2

/cars/key3/key1

But I can’t because the route doesn’t accept it and gives an error!

Well, that won't be possible, please note that optional parameters won't work if they're in the middle.

From the Route Properties => /cars/key2 is: /cars//key2


Maybe you can find a workaround from this:

https://www.webmotors.com.br/carros-usados/estoque?tipoveiculo=carros-usados&cambio=Automática&combustivel=Álcool

I need to do something similar, isn’t there a solution?

@Teodor @George

Using the script below, I was able to get the variables even out of order, now I need to know how to call these variables within Wappler and be able to use their value to create a filter.

<script>

    //console.log ("Window Location:", window.location);

    const myKeysValues = window.location.search;

    //console.log("Keys & Values:", myKeysValues);

    const urlParams = new URLSearchParams(myKeysValues);

    const param1 = urlParams.get('key1');

    const param2 = urlParams.get('key2');

    const param3 = urlParams.get('key3');

    console.log("01=", param1);

    console.log("02=", param2);

    console.log("03=", param3);

</script>

HOW ARE THE ROUTES!
rotas

LINK / CONSOLE