Table Assigning to another Table Error

I’ve come across a weird experience regarding tables, for some reason the “Default template” table is being altered even though here im assigning another table to = the default template (so to have the default template replace the other table)

image

Now this is the default template table:
image

now for some reason when i’m making the PartyTable[QueueBox] = to the template table (so the template table should replace whatever content is in PartyTable[QueueBox], however for some reason, if we look at the prints below:

How is it possible for the DefaultTable[“Template”] to have been altered?

There’s 3 matches for DefaultTable image

1 Like

This is how tables work as they are passed by reference.

You will need to clone the table in order to have a fresh copy that won’t alter the original table.

2 Likes

Thanks for replying, but how is defaulttable[“Template”] being altered when im just assigning it to replace another table?
e.g.: PartyTable[QueueBox] = DefaultTable[“Template”]

1 Like

Changing PartyTable[QueueBox] will change DefaultTable[“Template”]

This should be a good explanation for the phenonemon:

As @dthecoolest said, tables pass by reference not value so you are editing the exact same table

List of what’s passed by reference and what’s passed by value

thank you, i called the shallowCopy function passing the DefaultTable through it, however, it seems to still somehow become altered? (if you look at the prints and the arrows)

image --ShallowCopy function image

this is the default table:

image you see how Leader = “”

It seems to work the first time, but then the second time it seems altered:

Please if anyone could help regarding the message twice above (^^)