How to Update a record in a list variable

Example I have a list of record variable called "ProductStockList" which contain record of "ProductName" and "Qty", and this is the sample data:

[0]"Books",5

[1]"Pencil",2

[2]"Ruler",3

My question is, If i want to update the qty of Pencil which is on Index 1, how to do it?

Hi,

 If you now the position in the list you can manipulate the entry directly

ProductStockList[1].ProductStock.Quantity = 123

The value between [] can also be a parameter instead of s constant value.

Regards,

Daniel


Daniël Kuhlmann wrote:

Hi,

 If you now the position in the list you can manipulate the entry directly

ProductStockList[1].ProductStock.Quantity = 123

The value between [] can also be a parameter instead of s constant value.

Regards,

Daniel


Hi Daniel,

This can be done using normal assign right? no need of list append?

Thanks.


Joseph Enriquez wrote:

Hi Kevin!

I think ListRemove then ListInsert could do that.


https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/System_Actions#Client_ListRemove

https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/System_Actions#ListInsert

Kind regards,
Joseph Enriquez

Here's the idea in action.

Kind regards,
Joseph Enriquez


Kevin Wie wrote:

Daniël Kuhlmann wrote:

Hi,

 If you now the position in the list you can manipulate the entry directly

ProductStockList[1].ProductStock.Quantity = 123

The value between [] can also be a parameter instead of s constant value.

Regards,

Daniel


Hi Daniel,

This can be done using normal assign right? no need of list append?

Thanks.


Correct