Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Issue with using system functions in parameter presets

Hi there,

I'm trying to dynamically append values to a list parameter using the 'Parameter Preset' box when certain conditions are met for a transitional route. 

The list parameter is defined as follows: 

Screenshot 2023-01-25 at 14.49.25.png

Then, during the route I use the following system function:

 

$sys.func.APPEND($session.params.negative_products, credit score)

 

Screenshot 2023-01-25 at 14.50.40.png

 However, when the condition is met during the conversation, the updated value in $session.params.negative_products is not: [" ", credit score], but prints out the whole text in the parameter preset box, e.g., $sys.func.APPEND($session.params.negative_products, credit score). 

Why is this the case? I thought system functions were able to be used to dynamically change values in parameter presets and I have no idea why it just keeps on printing out the function as a string! 

Any help would be much appreciated,

Vicky

Solved Solved
0 2 1,389
1 ACCEPTED SOLUTION

Hey!

When referencing the parameter in my fulfilment I use: 

$session.params.negative_products

 I did figure a workaround yesterday. I realised when I define $session.params.negative_products within the 'Entry Fulfilment', 'Parameter Presets' section of the page the appending works: 

1. Define empty list parameter in presets of the Entry Fulfilment, i.e., before I want to append to the list: 

Screenshot 2023-01-27 at 09.58.38.png

 2. During a conditional route, append to the empty list using system functions in the parameter presets with the following command: 

$sys.func.APPEND($session.params.negative_products, "credit score")

Screenshot 2023-01-27 at 09.59.57.png

3. This then prints out the correct output when referencing $session.params.negative_products: 

" , credit score"

I think my original issue was that when trying to define $session.params.negative_products as a 'isList' parameter, it wasn't actually generating a list per se. So, when I was trying to call it in $sys.func.APPEND(), the function wasn't reading the $session.params.negative_products as a list, and as a result, just printed out the system command. 

Hope this helps other users who get faced with a similar issue!

Vicky

View solution in original post

2 REPLIES 2

Hi!

Welcome to Google Cloud Community!

To properly replicate your use case, can you show how you called the parameter on your fulfillment?

Hey!

When referencing the parameter in my fulfilment I use: 

$session.params.negative_products

 I did figure a workaround yesterday. I realised when I define $session.params.negative_products within the 'Entry Fulfilment', 'Parameter Presets' section of the page the appending works: 

1. Define empty list parameter in presets of the Entry Fulfilment, i.e., before I want to append to the list: 

Screenshot 2023-01-27 at 09.58.38.png

 2. During a conditional route, append to the empty list using system functions in the parameter presets with the following command: 

$sys.func.APPEND($session.params.negative_products, "credit score")

Screenshot 2023-01-27 at 09.59.57.png

3. This then prints out the correct output when referencing $session.params.negative_products: 

" , credit score"

I think my original issue was that when trying to define $session.params.negative_products as a 'isList' parameter, it wasn't actually generating a list per se. So, when I was trying to call it in $sys.func.APPEND(), the function wasn't reading the $session.params.negative_products as a list, and as a result, just printed out the system command. 

Hope this helps other users who get faced with a similar issue!

Vicky