How to delete all labels on a token using FlexScript?

How to delete all labels on a token using FlexScript?

jon_abbott
Not applicable
382 Views
5 Replies
Message 1 of 6

How to delete all labels on a token using FlexScript?

jon_abbott
Not applicable

[ FlexSim 20.0.5 ]

I'm trying to delete all labels on a token using FlexScript. I've tried this example but it didn't seem to work. Is there another way to delete all labels on a token using FlexScript? Thanks in advance for your help.

0 Likes
Accepted solutions (1)
383 Views
5 Replies
Replies (5)
Message 2 of 6

joerg_vogel_HsH
Mentor
Mentor

Create Token activity to get a new token, then you send the token with all labels simply into a sink activity.

0 Likes
Message 3 of 6

jon_abbott
Not applicable

Thanks @Jörg. So is there no way to do this using FlexScript? I can remove one token label using FlexScript with no problem, but removing all labels at once seems to not work for me.

0 Likes
Message 4 of 6

joerg_vogel_HsH
Mentor
Mentor
Accepted solution
token.as(treenode).subnodes["labels"].subnodes.clear();
This works for a custom code.
0 Likes
Message 5 of 6

jon_abbott
Not applicable

Thank you @Jörg, this works. I was hoping it would be as simple as

token.labels.destroy();

or

token.labels.clear();

But your code still works nicely. :^) Thanks again.

0 Likes
Message 6 of 6

__ANON_USER__1
Not applicable
Closing outdated question
0 Likes