In the past I put up a post about how to send a list into a URL parameter and extract that list.
Recently, I decided in an attempt to bypass the database for some WU savings on some tasks, like shopping cart, as well as to provide some nice features in the app as well, to revisit this.
Firstly, the regex pattern to extract the list of items in the URL parameter is [^,\s][^,]*[^,\s]*
this will allow you to extract a list of texts, which can be used as constraints for all sorts of other data types or option set filtering to get the right set of values.
In order to send in more values to the list or remove values from the list you can use the below type of navigation go to page workflow action. Use plus item to add and minus item to remove. In the below screen shot the extract with regex uses the above regex pattern.
So, I wanted to take this further as I needed to create not just a list of items in the URL parameter, I also needed to attach a list of things to each item…think of it kind of like JSON in the URL but not really as there are no key value pairs and you will just need to remember the position of each item.
For example, I have a type of food as a menu item that can be customized and a list of customization choices. The order will have multiple food items selected, so need the first concept of a list in URL parameter as described above. But, I need to ‘attach’ the customization choices to each menu item independently, so think that a particular dish will have customizations of large and no veggies and extra spicy, while another menu item in the order will have customizations of small and extra veggies and no spicy.
To extract these values as well I used this regex pattern [^|\s][^|]*[^|\s]*
…each item of customizations are separated by |
So I can use a double regex extraction in the dynamic expression to extract from the URL like below
The first extract with regex is the first pattern in this post and the second is the second pattern in this post.
Below is screen shot of a nested repeating group
So, with this, I’ve taken a 12 step form with around 30 values required, 4 sets of lists and 4 sets of lists within lists…never touched the database and provided payment without user signed in and only storing the necessary values in database after payment is successful.
I don’t want to pay for WUs that do not equate to money for the app.