Automatically create a new Preparation, Determination, or Collection Object Attribute upon CO creation

Why to autogenerate a Preparation, Determination, or Collection Object Attribute upon creation

This streamlines the data entry process, so that when a user creates a new collection object, one or all of the preparation/determination/attribute records are created automatically, without the user needing to add them.

This reduces the number of clicks for the person creating the record and allows administrators to make fields in related tables mandatory (in the form definition XML or schema) before a new collection object record can be created.

Find Collection ID

First, navigate to the following URL in your instance:

http://example.specifycloud.org/specify/query/new/collection/

Replace example.specifycloud.org with your Specify 7 URL. This will begin building a new query on the Collection table.

In this query, you will want to include both the ID and the Collection Name. To see ID, you will likely need to enable the “Reveal Hidden Form Fields” in the bottom right of the query builder.

Now we can see that this collection has an ID of 4. We can proceed to the App Resources interface and change the new Collection Object record creation behavior.

Change new record behavior

Now that we have the Collection ID, we can add one or more new remote preferences.

After clicking on the Remote Preferences app resource under Global Resources, I added the following three lines:

You can use any combination of the three as they work independently of each other.

Upon the creation of a new Collection Object, each line tells Specify to do the following action:

Create a new Collection Object Attribute record

CO_CREATE_COA_4=true

Create a new Determination record

CO_CREATE_DET_4=true

Create a new Preparation record

CO_CREATE_PREP_4=true

That’s it! Save and clear your cache.

Now when you create a new Collection Object, your desired record will be created automatically.

2 Likes

Hello - that looks valuable. A few questions about it:

  1. Could this be done for other forms/record entities as well?
  2. How do you find the codes for different records (i.e. that COA is for collection object attribute)?
  3. Is there a need to scope this? or does the fact that these records are dependent on a collection object do that? Is it possible to do something similar for records that are related but independent?

Very useful feature for our catalogers ! They are loving it (less clicks) and asking for more actually :sweat_smile:

In CAY we have opted for 1 Collection Object (CO) <==> 1 Collecting Event (CE)

So a property CO_CREATE_PREP would be quite natural and useful in our CO data entry form. This is how it looks so far:

A quick glimpse on github specify/specify7 showed that PRED, DET and COA and the only three declared properties.

Could I create a feature request issue for such addition or are there any good reason for not adding a CO_CREATE_CE property?

Thanks,
Philippe V.

Hi @pverley,

“Embedded” Collecting Events (CE) are automatically created upon entering the new Collection Object (CO) form. If you have your collection set to use these embedded events, it should be created without your catalogers needing to click any button at all.

Can you check and make sure that you have your CEs set to be embedded in the collection record for this collection in your database?

See here: Shared vs. Embedded Records & Configuration

Right on! We decided to go embedded collecting events but I did not ensure that it was correctly configured in the db. Done.
And it works like a charm :dizzy: Thank you !

Side note: so far I’ve always ended up finding mots answers thanks to existing Documentation topics, but I sometimes struggle to find the way to the piece of information mostly because I do not know what I’m looking for. Matter of a growing acquaintance with Specify concepts step by step.

1 Like

Quick question on this for anyone who knows – is there an analogous app resource definition for making a new preparation attribute record automatically for any new preparation?
I’m imagining it’s a remote preference line that says
“PREP_CREATE_[something]” but don’t know what the correct abbreviated form of Prep attribute would be for this.
Is there a list somewhere of all of the xml-ified names for different tables?

Hi @nfshoobs,

At this time, it is not possible to create new records automatically in any given related table. We only support:

  • Collection Object Attribute
  • Determination
  • Preparation

I’ve added your comment to the corresponding GitHub Discussion topic:

Unfortunately, this means you can only automatically create a new Preparation, not a new Preparation Attribute.

1 Like

Got it, thanks Grant! Hope to see it in some future release, but for now, even adding determinations and preps automatically is nice and helps speed things up while cataloging.

1 Like