Is ObjectLink() globally unique?

Hi all,

We’re looking at using the entire ObjectLink() as a parameter to identify a row in a table.

I’m curious if the community has encountered scenarios where using ObjectLink() has proven to be non-unique?

Here’s the background:

We’re releasing a UUID pack that is globally unique (i.e. never provides the same UUID in the life of the pack).

This would enable docs to serve as a System of Record in syncing with other docs, SaaS platforms, and data sets.

We’re using an Action Formula (pack Button) to initiate the request for a UUID, but due to issues with Coda’s fetcher caching we need to provide a unique parameter to ensure that Coda does not return the results of a previous request. We have tried disabling caching, but if a button on two rows is clicked in rapid succession it still returns the previous value.

We’re aware that the ObjectLink() for a row changes depending on whether the doc is published or not.

We were curious if anyone has attempted to use the ObjectLink as a unique ID and if they’ve run into edge cases where it was not unique?

Special thanks to @Paul_Danyliuk @Scott_Collier-Weir @Christiaan_Huizer and @Leandro_Zubrezki for the significant amount of work you’ve done exploring this topic & sharing what you’ve learned!

I haven’t tried using it like that and I haven’t run into edge cases.

There is one theoretical edge case I can think about. ObjectLink() only uses the last three characters of a table ID, i.e. _tuXXX, within the result. Given that each character is one of 63 possibilities (lowercase and uppercase alphabet, digits, and an underscore), round it to 64, there’s 262144 combinations in total (18 bits of randomness).

So yeah, unlikely that anyone would make that many tables in a doc, or that the doc would at all allow it. However, when I was looking through Coda’s frontend code, the ID generating function that I found wasn’t checking for the uniqueness of the generated ID — it was a basic Math.random. I haven’t searched if there was perhaps some wrapper around that function that would ensure uniqueness across the doc. If it’s not there, there’s always a risk of collisions. Unlikely but theoretically possible.

P.S. A lot also depends on how you’re going to transform the object link into UUID. See if you’re not losing bits of entropy there.

P.P.S. Ah got it, you’re not generating UUIDs out of object links, you’re just using it as an anti-cache param. Should be fine for that purpose.


Yeah assumption here is that Coda doesn’t generate the same ObjectLink() for a table inside one doc. Thanks Paul!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.