question

Manuel Sinco avatar image
0 Likes"
Manuel Sinco asked Manuel Sinco commented

How to check if a Column in a Global Table exist?

I want to check if a column in a global table with a certain name exists, if not create that column.

Thanks,

Manuel.

FlexSim 19.1.0
columnexist
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

·
tannerp avatar image
1 Like"
tannerp answered Manuel Sinco commented

Hi @Manuel Sinco,

I used the getColHeader() function to parse through the column header values to match to a desired name. If the name is not in any of the columns, a new column with the desired name is added. Here's a model with the code you can test. Simply press Play on the Script and watch it add "Col 5" to GlobalTable1.

column-value-lookup.fsm


· 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.

Manuel Sinco avatar image Manuel Sinco commented ·

Thanks Tanner, I thought about it before posting the question. I was thinking about a command referring maybe to the tree to assert something, but if it does not exist is okay.

I accept the answer based on that someone can use it.

Thank you.

0 Likes 0 ·

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.