Design advice - Custom Document Id provider (sort of/maybe?)

Copper Contributor



I've posted this in the Sharepoint General Discussion but I'm not sure that's where this discussion belongs:


If anyone has ideas, opinions and even better, a best-practice solution I'd be much obliged.



3 Replies

Hi @sharonH 

this is a nice Information Architecture design exercise  :)

From my point of view, critical points are:

  • When a document is moved to another document library the ID column value moves with it.
  • The column is indexed and searchable.  Need fast retrieval
  • That it doesn't interfere with sites that already use the out of the box Document ID service
  • The value can be empty/null too

Some questions:

  • How many documents do you think you have to manage?
  • must the identifier be unique?
  • The value shouldn't be easy for end-users to view/edit. 


Shortly, considering that the Term Store (managed metadata) has limits (200k items), and when you change site-collections, without using Content Type HUB, field metadata copy doesn't work very well, because they use an internal (and hidden) lookup list.


I think that the best solution without running into some SharePoint limits is to use a Custom Database (Mongo DB, SQL Server, maybe on Azure) that acts as a "unique identity generator". Then, on your site, you can define a Content-Type, with a simple text field, in order to store your custom unique id. Please think about Document Library sizing, you can store up 30M files in a document library, but I suggest to create N Document library following a functional logic (es Year? Customer?).

When you move a document inside the same site collection, and documents have the same content type, filed columns metadata (like string, number) will be moved with it, cross-site collection too (if the content type has been created equal between all the site collections).

If you are working only with one site collection, you can retrieve a document without knowing where is it (folder path), just using web.GetFileById API, this is a unique id valid inside the same site collection, so you can store it together with the unique id custom on the database.

What about edit custom id? Edit Form are customizable on sharepoint online using PowerApps but please, pay attention on licenses.

It's not easy, but try to imagine a solution of this kind :)





@Federico Porceddu 


Thanks for the feedback Federico.  Much appreciated.  Just so I'm sure I understand...I'm unclear on "Then, on your site, you can define a Content-Type, with a simple text field, in order to store your custom unique id. "  How do you do this?  I see content-type is a document attribute (set to "Document" in Sharepoint).  Do you mean a column in a list?


Many Thanks!



Hi Sharon,
sorry, I can explain better. Sure, document have list columns, but in this case, I think you need to use content type which are a set of metadata/site columns, so you can define one time your Content Type, and apply it multiple time to multiple Document Library, and sharing same structure definition.
If I. Future you need to modify this definition (es adding a column), you can do it directly into the content type, and it will be propagated to all items.