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

%3CLINGO-SUB%20id%3D%22lingo-sub-1036948%22%20slang%3D%22en-US%22%3EDesign%20advice%20-%20Custom%20Document%20Id%20provider%20(sort%20of%2Fmaybe%3F)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1036948%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20posted%20this%20in%20the%20Sharepoint%20General%20Discussion%20but%20I'm%20not%20sure%20that's%20where%20this%20discussion%20belongs%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FSharePoint%2FDesign-advice-Custom-Document-Id-provider-sort-of-maybe%2Fm-p%2F1036824%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FSharePoint%2FDesign-advice-Custom-Document-Id-provider-sort-of-maybe%2Fm-p%2F1036824%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20anyone%20has%20ideas%2C%20opinions%20and%20even%20better%2C%20a%20best-practice%20solution%20I'd%20be%20much%20obliged.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%2FSharon%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1045303%22%20slang%3D%22en-US%22%3ERe%3A%20Design%20advice%20-%20Custom%20Document%20Id%20provider%20(sort%20of%2Fmaybe%3F)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1045303%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F470928%22%20target%3D%22_blank%22%3E%40sharonH%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethis%20is%20a%20nice%20Information%20Architecture%20design%20exercise%26nbsp%3B%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3EFrom%20my%20point%20of%20view%2C%20critical%20points%20are%3A%3C%2FP%3E%3CUL%3E%3CLI%3EWhen%20a%20document%20is%20moved%20to%20another%20document%20library%20the%20ID%20column%20value%20moves%20with%20it.%3C%2FLI%3E%3CLI%3EThe%20column%20is%20indexed%20and%20searchable.%26nbsp%3B%20Need%20fast%20retrieval%3C%2FLI%3E%3CLI%3EThat%20it%20doesn't%20interfere%20with%20sites%20that%20already%20use%20the%20out%20of%20the%20box%20Document%20ID%20service%3C%2FLI%3E%3CLI%3E%3CSPAN%3EThe%20value%20can%20be%20empty%2Fnull%20too%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3ESome%20questions%3A%3C%2FP%3E%3CUL%3E%3CLI%3EHow%20many%20documents%26nbsp%3Bdo%20you%20think%20you%20have%20to%20manage%3F%3C%2FLI%3E%3CLI%3Emust%20the%20identifier%20be%20unique%3F%3C%2FLI%3E%3CLI%3E%3CSPAN%3EThe%20value%20shouldn't%20be%20easy%20for%20end-users%20to%20view%2Fedit.%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EShortly%2C%26nbsp%3Bconsidering%20that%20the%20Term%20Store%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fservicedescriptions%2Fsharepoint-online-service-description%2Fsharepoint-online-limits%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Emanaged%20metadata%3C%2FA%3E)%20has%20limits%20(200k%20items)%2C%20and%20when%20you%20change%20site-collections%2C%20without%20using%20Content%20Type%20HUB%2C%20field%20metadata%20copy%20doesn't%20work%20very%20well%2C%20because%20they%20use%20an%20internal%20(and%20hidden)%20lookup%20list.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20think%20that%20the%20best%20solution%20without%20running%20into%20some%20SharePoint%20limits%20is%20to%20use%20a%20Custom%20Database%20(Mongo%20DB%2C%20SQL%20Server%2C%20maybe%20on%20Azure)%26nbsp%3Bthat%20acts%20as%20a%20%22unique%20identity%20generator%22.%20Then%2C%20on%20your%20site%2C%20you%20can%20define%20a%20Content-Type%2C%20with%20a%20simple%20text%20field%2C%20in%20order%20to%20store%20your%20custom%20unique%20id.%20Please%20think%20about%20Document%20Library%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice365%2Fservicedescriptions%2Fsharepoint-online-service-description%2Fsharepoint-online-limits%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Esizing%2C%3C%2FA%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eyou%20can%20store%20up%2030M%20files%20in%20a%20document%20library%2C%20but%20I%20suggest%20to%20create%20N%20Document%20library%20following%20a%20functional%20logic%20(es%20Year%3F%20Customer%3F).%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EWhen%20you%20move%20a%20document%20inside%20the%20same%20site%20collection%2C%20and%20documents%20have%20the%20same%20content%20type%2C%20filed%20columns%20metadata%20(like%20string%2C%20number)%20will%20be%20moved%20with%20it%2C%20cross-site%20collection%20too%20(if%20the%20content%20type%20has%20been%20created%20equal%20between%20all%20the%20site%20collections).%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EIf%20you%20are%20working%20only%20with%20one%20site%20collection%2C%20you%20can%20retrieve%20a%20document%20without%20knowing%20where%20is%20it%20(folder%20path)%2C%20just%20using%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fit-it%2Fdotnet%2Fapi%2Fmicrosoft.sharepoint.client.web.getfilebyid%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Eweb.GetFileById%3C%2FA%3E%20API%2C%20this%20is%20a%20unique%20id%20valid%20inside%20the%20same%20site%20collection%2C%20so%20you%20can%20store%20it%26nbsp%3Btogether%20with%20the%20unique%20id%20custom%20on%20the%20database.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EWhat%20about%20edit%20custom%20id%3F%20Edit%20Form%20are%20customizable%20on%20sharepoint%20online%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fit-it%2Fpowerapps%2Fmaker%2Fcanvas-apps%2Fcustomize-list-form%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Eusing%20PowerApps%3C%2FA%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ebut%20please%2C%20pay%20attention%20on%20licenses.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EIt's%20not%20easy%2C%20but%20try%20to%20imagine%20a%20solution%20of%20this%20kind%20%3A)%3C%2Fimg%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ECheers%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EFederico%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1045444%22%20slang%3D%22en-US%22%3ERe%3A%20Design%20advice%20-%20Custom%20Document%20Id%20provider%20(sort%20of%2Fmaybe%3F)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1045444%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F138334%22%20target%3D%22_blank%22%3E%40Federico%20Porceddu%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20the%20feedback%20Federico.%26nbsp%3B%20Much%20appreciated.%26nbsp%3B%20Just%20so%20I'm%20sure%20I%20understand...I'm%20unclear%20on%20%22%3CSPAN%3EThen%2C%20on%20your%20site%2C%20you%20can%20define%20a%20Content-Type%2C%20with%20a%20simple%20text%20field%2C%20in%20order%20to%20store%20your%20custom%20unique%20id.%26nbsp%3B%22%26nbsp%3B%20How%20do%20you%20do%20this%3F%26nbsp%3B%20I%20see%20content-type%20is%20a%20document%20attribute%20(set%20to%20%22Document%22%20in%20Sharepoint).%26nbsp%3B%20Do%20you%20mean%20a%20column%20in%20a%20list%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EMany%20Thanks!%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%2FSharon%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1045880%22%20slang%3D%22en-US%22%3ERe%3A%20Design%20advice%20-%20Custom%20Document%20Id%20provider%20(sort%20of%2Fmaybe%3F)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1045880%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Sharon%2C%3CBR%20%2F%3Esorry%2C%20I%20can%20explain%20better.%20Sure%2C%20document%20have%20list%20columns%2C%20but%20in%20this%20case%2C%20I%20think%20you%20need%20to%20use%20content%20type%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-docs%2Fblob%2Fmaster%2Fdocs%2Fscenario-guidance%2FEnterprise-Content-Management.md%23site-columns-and-content-types%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-docs%2Fblob%2Fmaster%2Fdocs%2Fscenario-guidance%2FEnterprise-Content-Management.md%23site-columns-and-content-types%3C%2FA%3E%20which%20are%20a%20set%20of%20metadata%2Fsite%20columns%2C%20so%20you%20can%20define%20one%20time%20your%20Content%20Type%2C%20and%20apply%20it%20multiple%20time%20to%20multiple%20Document%20Library%2C%20and%20sharing%20same%20structure%20definition.%3CBR%20%2F%3EIf%20I.%20Future%20you%20need%20to%20modify%20this%20definition%20(es%20adding%20a%20column)%2C%20you%20can%20do%20it%20directly%20into%20the%20content%20type%2C%20and%20it%20will%20be%20propagated%20to%20all%20items.%3CBR%20%2F%3E%3CBR%20%2F%3ECheers%2C%3CBR%20%2F%3EFederico%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi,

 

I've posted this in the Sharepoint General Discussion but I'm not sure that's where this discussion belongs: https://techcommunity.microsoft.com/t5/SharePoint/Design-advice-Custom-Document-Id-provider-sort-of-...

 

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

 

/Sharon

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 :)

 

Cheers,

Federico

 

@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!

 

/Sharon

Hi Sharon,
sorry, I can explain better. Sure, document have list columns, but in this case, I think you need to use content type https://github.com/SharePoint/sp-dev-docs/blob/master/docs/scenario-guidance/Enterprise-Content-Mana... 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.

Cheers,
Federico