question

Nilsson avatar image
0 Likes"
Nilsson asked Jeanette F commented

Split array as multiple entries when pushing to list

Hello!

I have tokens containing arrays with multiple types in them. Is there a way of pushing the different values in the array as individual values to a list?

1713511238427.png

I also want the different types (different part numbers) to only appear once, and the amount of them to be summarized as a total. The first value in the types array is connected to the first value in the PackagesPerPallet array.

FlexSim 23.1.0
listpush to list
1713511238427.png (64.2 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Nilsson, was Joerg Vogel's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel edited

You push onto a list values. This can be references of tokens, items, treenodes and objects. You can push strings, integer or double datatypes as a value. Each value is a key. By reading this key you can get additional attributes as fields in a list. If you push a number like 1 then there is not much you can do with this information to add fields. On the other hand if you push a token onto list and this token has got label values stored, then you add fields of these labels to your list, too.

A push action cannot analyze tuple structures of two or more independent datatypes or arrays and get automatically a relation between them.
If you want to realize a new list by a key value and custom independent fields you can push this as a list parameter onto a list.

If you have an array of key values, then you can push this array. Each array element is a single key value, then. You get then field values, which you can evaluate from the key value.

unique list entries is an option of a list.

accumulating of field values is an option from a dynamic field.

limits of both options are discussed in manual about lists.

5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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