question

Jay K9 avatar image
0 Likes"
Jay K9 asked Jay K9 commented

How to selectively Pull from from using Label Array?

I have 2 lists. One which keeps track of parts it has created. It has a label column called PartName.

Second list is parts requested by operator which also has a label column PartName.

When the a value it pushed in second list as a request by operator it triggers the flow.

The flow starts with a pull request from first list which pulls one value and Assign to token.requestpull

The flow moves to a batching step where I batch 3 token with a max wait time of 60 sec. I also track how many were batched before getting released

In batching process flow for label aggregation I have

From Label - requestpull.Partname

To Label - requestpull

Aggregation - Make Array


Then I want to pull from first list. The request quantity of pull from first list is the number of token I have batched which is store in label batchCount (this works right) I have puller token for second list as pullerrequest

For query I only want to select parts which are requested by operators so

WHERE PartName IN pullerrequest.requestpull


This however does not work and shows sql query mistake. Where am I making a mistake?



FlexSim 23.0.15
listslist pullsql queries
· 4
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·

Try IN clause argument with brackets.

pullerrequest.requestpull datatype must be an array. Elements of this array must match with PartName. Print arguments into an output console for testing.

look for examples in https://www.w3schools.com/sql/sql_in.asp

1 Like 1 ·
Jay K9 avatar image Jay K9 Joerg Vogel commented ·
Got a work around but it works now. Thanks!
0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ Jay K9 commented ·
Can you share your solution and accept it?
0 Likes 0 ·
Show more comments

1 Answer

·
Jay K9 avatar image
0 Likes"
Jay K9 answered

You can create assign a label called NameArray and in values select Array and Set Array. In that portion added the following as code.

Array values = Array(arraySize);

for(int i=1; i<=arraySize;i++){
values[i] = token.requestpull[i].PartName;
}


return values;



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.