I would like to get the users count of a doc to take some actions, is there any function for that?
Dear @Jonathan_Solorzano, welcome to the community
Unfortunately I am not aware how to do, but in this community and from the Codans we could expect some creative input
for the idea, to only thing that comes in mind is to make a table from all users that have access to the doc and accordingly to measure against this table.
Obviously the shortcoming is how to assure that it’s up to date according the actual sharing settings
There’s a secret formula: $$[grid:Global-Document-People]
. It returns a table of all users in the doc, so you can .Count()
on that. It includes system users like Automation Bot and System Writer though, so adjust accordingly:
WARNING: really unsafe to use in production! It may get you on the radar and your doc disabled by Codans.
Props to @Dalmo_Mendonca for discovering this.
Codan here
I highly recommend not using “system” or “Global” grids in this manner. We are changing how these things work behind the scenes routinely and using them directly is guaranteed to break your doc at some point.