question

Tamilselvan avatar image
0 Likes"
Tamilselvan asked Jeanette F commented

Copy Table to Token Label

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

FlexSim 23.1.1
label
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

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 0 ·
Jeanette F avatar image Jeanette F ♦♦ commented ·

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

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered
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];
5 |100000

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