Running into trouble saving objects in tables (SOLVED)

Hi,

So how’s everybody doing? Day 4 of lockdown in my part of the world.

I’m still a newbie and this issue probably has a simple solution but for the life of me, I can’t figure it out.

I’m using factory.create to make a bunch of objects and store them in a table.

I can print them out like this.

Then later, I save some of them into another table from the component script.

But this time when I print out the object, I’m getting something different like this with the addition of “cursor”.
c4

My question is why is this different? How do I save the original bunch of objects in the second table? Thanks.

The difference is that one is an instance id, (/instance6) which is a hash, and the other is a URL (cursor:/instance6).

1 Like

You can use both in calls to any of the go.* functions

You can use both in calls to any of the go.* functions

That’s what I want to do - change a property on one of the instances. But I think the problem arises from the fact that I’m calling msg.url from another folder. Can that be the problem? How do I call msg.url in the right way?


mydata.selectedGO[i] is already a URL I think. Try:

local url = msg.url(nil, piece.path, "script")
1 Like

Thank you. That works. :grinning: