question

Amanda Prado avatar image
0 Likes"
Amanda Prado asked Felix Möhlmann answered

Search the global table for the label value and return the column value

Good afternoon everybody !

Simulation:

Warehouse Payment System, where 50 items types are paid for SPMKT. I'm creating 50 items types through 50 sources. Each source, when creating the item, already configures a label with the item's respective Part Number.

As the number of boxes for each item are different, each item has a different number of boxes that the operator picks up at a time and, for this reason, all the logic is happening in the process flow.

I have a Global Table that contains the Part Numbers and the quantities that need to be paid at a time. The point of my doubt is the following:

I'm using a list in PF to pull items according to my global table:


1732125386055.png

It turns out that there are 50 Part Numbers and I am imputing the line number for each item. I would like to know if there wouldn't be a way to make Flexsim look for the line in my table, using the label I created in the source, and return the value column, something like this, more or less:

Table("BOM")[item.(labelname)][colum] ????


As well as the load and unload locations, I am configuring them manually, but I would like you to pull, according to the label, the origin and destination location, which is also included in the Global table.

I hope I was able to be clear enough on the issue.


Thank you very much !

Yours sincerely.

FlexSim 24.2.1
global table
1732125386055.png (26.3 KiB)
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
0 Likes"
Felix Möhlmann answered

The "getValueByKey" method does this.

https://docs.flexsim.com/en/24.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Table.html#Method-getValueByKey

Though I don't see a reason why you couldn't also have the row number as a token label, since using that directly will be faster than having to search the table for a matching value each time.

5 |100000

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