Copy Table to Token Label

Copy Table to Token Label

Tamilselvan
Not applicable
37 Views
3 Replies
Message 1 of 4

Copy Table to Token Label

Tamilselvan
Not applicable

[ FlexSim 23.1.1 ]

I have queried the Table (GlobalTable1) in custom code using SQL, Now i am trying to clone or copy the result to the Token Label is there is any way to copy the result to label using the flexscrpit

0 Likes
Accepted solutions (1)
38 Views
3 Replies
Replies (3)
Message 2 of 4

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Tamilselvan,

Thank you for contributing to our community! We couldn't identify a maintained license or subscription linked to your account.

You may need to update your profile information to identify yourself as a license owner or their associate. Check out our article for how to ensure you receive timely support. If you update your profile comment back to let us know - we'll adjust the priority of your post accordingly.

If your current license is expired, please contact your local distributor to renew.

0 Likes
Message 3 of 4

moehlmann_fe
Explorer
Explorer
Accepted solution
Table result = Table.query("...");
result.cloneTo(token.labels.assert("labelName", labelValue);

This will copy the table to the label node. labelValue will be what is shown as the value of the table. To later access the table again, you have to cast the treenode as a table.

Table result = token.labels["labelName"];
Variant value = result[1][1];

Or all in one line.

Variant value = token.labels["labelName"].as(Table)[1][1];
0 Likes
Message 4 of 4

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Tamilselvan, was Felix Möhlmann'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