SELF_HYPERLINK() returns wrong url

I am using SELF_HYPERLINK() to make links inside a document on a self-hosted grist.

But for some reason it returns wrong document id (in the url between domain name and doc name).

Exactly it shows /s.ab9iuAmuD7jE9xnCbsvxpc/ instead of /mhwDM83vLmT3/

May be it should be reset somewhere?

Huh! That almost looks like a “share id” mechanism used for forms. Do you see this in a fresh new document or is it something special? Would appreciate any tips on how to replicate the problem so we can diagnose it.

We’ve been actively using this document for over a year. And this function did work fine before. But I can’t define what exactly happened before it broke.

I don’t see this problem in another documents on the same server.

Thanks for the follow-up. I think I’ve been able to replicate the problem. Looks like SELF_HYPERLINK() can return the wrong URL if your document has a share link (e.g. from publishing a form). If the server restarts or the document gets unloaded from memory, and the first thing that opens it again happens to be someone using the share link, then SELF_HYPERLINK() will start returning a URL based on that share link instead of the document’s real URL. The problem persists until the next server restart (and even then, it can happen again).

Will work on a fix. Thanks for reporting this!

1 Like

Update: we have a fix in hand. Will get released soon.

1 Like