question

Luis Gustavo Freitas avatar image
0 Likes"
Luis Gustavo Freitas asked Luis Gustavo Freitas commented

Can I use SELECT to push values to a list?

My question is about query and list,

I am using SELECT as quantifier to pull a certain amount of mass from a list, I would like push that value back to list, to the same line that i pushed it. Can I do that? If yes, how?

FlexSim 21.2.4
querylists
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Felix Möhlmann avatar image
2 Likes"
Felix Möhlmann answered Luis Gustavo Freitas commented

If you are using a global list, you can use the "UPDATE" keyword in the "Table.query()" command to set certain values on the list/table. To update the correct row, you'd also need to pull some identifier of the row you pulled from (row number, respective item, ID value,...).

In the attached example I simply push some tokens with a "Quantity" label to a list. Another token then "SELECT"s some of that quantity and later updates the list value again, using the value (token) to identity the row.

UpdateList.fsm


updatelist.fsm (105.8 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Luis Gustavo Freitas avatar image Luis Gustavo Freitas commented ·
Thank you @Felix Möhlmann, that's what i needed.
0 Likes 0 ·