Event On Parameteres Change - List Append
Question
Application Type
Reactive
Service Studio Version
11.12.0 (Build 48966)

When I try to add an item that comes from a list as an input parameter, using the On Parameters Changed event in a Block, sometimes it adds the item, and again not, this is some kind of bug, or it has this behavior same?

Screenshot2.png

mvp_badge
MVP

Hi,

Ensure that you are not passing the same input parameter value consecutively to the respective block? If so, then the block OnParametersChanged event won't get invoked. 


Kind regards,

Benjith Sam

Hi Bejith,

I'm passing a different value that exists in the list, and I needed to add it to the end of the list!


Chess

mvp_badge
MVP

Hi "Delivery",

Make sure that you never ListAppend the Current of a List to itself. This will result in the behaviour you described. Of course I'm not sure you are doing that, but it is a common mistake.

Hi Kilian.

I'm actually doing this, I need to insert an item at the end of the list that comes from the input parameter in the last index of it, is there any good practice for doing this?

Chess

mvp_badge
MVP

Hi,

You can ListAppend an Element of one list to another List, or you can ListAppend a local variable of the list element type to the List, or you can use the expand functionality in SS to add an element. But you can never add the Current of a List to that same List.

Hi Chess,

From what I've understood you have a block with an input parameter and that input is a list. And then you want to add an item to that list on the On Parameters Changed.

I would suggest creating a boolean in the main screen setting it as input of the block and everytime you do something where the block needs to run its prep just say that the boolean = not boolean so it changes its value and the block runs its prep. Still give the block the list.

That should work. I'm not sure if this is a best practice, tough, but it still should work bug free.

Cheers,

Luis M

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.