question

Joerg Vogel avatar image
0 Likes"
Joerg Vogel asked Matt Long answered

Why is the result no data, when nothing is pulled in an activity?

If I pull something from a list in the Pull from List activity and the result is empty, the label contains No Data. I get the same result when I pull from a list and the result variable is declared as a Variant in the source code. When the variable is declared as an Array I get at least an empty Array. It is disturbing to see a red arrow in the labels group of the quick properties window. An empty array looks more friendly, because I wouldn't assume I made a mistake.

FlexSim 17.2.5
no datapull from list activitypull nothing
· 2
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

Matt Long avatar image
0 Likes"
Matt Long answered

When you say:

  1. Array pulled = list.pull();

you are casting whatever value is returned from the pull() method into an Array. This will always cause the data to be an array with 0 or more elements. The Pull From List activity gives you back exactly what was pulled. So if nothing was pulled then it returns null, or no data.

If you want to display the pulled data as an array, you'll need to do the same thing your code is doing. Cast the value of the pulled data into an array.

5 |100000

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