Add a Collection in Specify-7

Hi there,

There is a dedicated thread on adding a Division, Discipline or Collection in Specify-6 but I could not find anything for Specify-7.

From Data Entry menu

I checked whether the collection table could be added in the Data Entry menu, but it was not listed:

cay-sp7-data-entry-table

From New Collection form

I tried with a direct link https://specify.herbier-guyane.fr/specify/view/collection/new and reached a New Collection form:

A click on Save gave an error:

“exception”: “IntegrityError”, “message”: “1364”, “data”: “Field ‘UserGroupScopeId’ doesn’t have a default value”

Specify 7 Crash Report - 2024-10-12T22_19_03.789Z.txt (356.9 KB)

From API Collection POST request

I attempted the collection creation from the API tables page https://specify.herbier-guyane.fr/documentation/api/tables/ with Collection POST request.

{
  "catalognumformatname": "CatalogNumberNumeric",
  "code": "BAS",
  "collectionname": "Bac a sable",
  "collectiontype": null,
  "dbcontentversion": null,
  "description": "Collection de test",
  "developmentstatus": null,
  "estimatedsize": 0,
  "guid": "string",
  "institutiontype": "string",
  "isembeddedcollectingevent": true,
  "isanumber": null,
  "kingdomcoverage": null,
  "preservationmethodtype": null,
  "primaryfocus": null,
  "primarypurpose": null,
  "regnumber": null,
  "remarks": null,
  "scope": null,
  "timestampcreated": "2024-10-12 22:35:58",
  "timestampmodified": "2024-10-12 22:35:58",
  "version": 0,
  "webportaluri": null,
  "websiteuri": null,
  "admincontact": "/api/specify/agent/3/",
  "contentcontacts": "/api/specify/agent/3/",
  "createdbyagent": "/api/specify/agent/3/",
  "discipline": "/api/specify/discipline/3/",
  "institutionnetwork": null,
  "modifiedbyagent": "/api/specify/agent/3/",
  "usergroupscopeid": 5
}

The same error was issued, unsurprisingly since the New Collection form eventually send and API request.

From mariadb collection table

On a last attempt (low level), I inserted successfully a new item in the collection table from mariadb command line:

And the Playground collection (Bac à sable in French) shows up in the the Collection View form https://specify.herbier-guyane.fr/specify/view/collection/5

:point_up: Questions please :question:

  1. Did I miss the documentation on how to add Division, Disciple or Collection with Specify-7?
  2. Would the form $base_url/specify/view/collection/new be the correct way to add a collection in Specify-7?
  3. If so, does the error message signify there might be something wrong with our database that should be investigated separately?

Thank you by advance,
Cheers,
Philippe V. (CAY & NOU herbarium)

Hi @pverley,

Thank you for reaching out and providing such detailed information! I appreciate your thoroughness.

As of now, there is not support for adding a Division, Discipline, or Collection in Specify 7. The URL you provided ($base_url/specify/view/collection/new) is indeed the correct way to access the new ‘Collection’ form in Specify 7; but it is not capable of creating a new collection at this time.

The error message regarding UserGroupScopeId is due to Specify’s form not auto-setting the field to the same value as the CollectionID.

Thank you for your patience and understanding! We are planning on adding this functionality sometime next year, but for now, we are tracking progress on the GitHub issue: