[Using self-hosted Specify v7.10.2.3 at the time of writing]
Hi there,
A colleague asked me whether we could add in our base information about collecting trips ? A quick glimpse at the Specify Schema showed me that Collecting Trip table already exists
Next, I thought about how to input the information about the trips with Sp7 GUI
Batch-edit ?
I crafted my query to output COs from the same trip and added empty columns Trip Name, Trip Start Date, Tripe End Date, etc. I saw the new button Batch Edit in the Query tab , but as explained in the documentation:
Bummer, that was not the way to do it.
Workbench ?
I tried in many ways to relate existing CE entries (even tried with COs) with new Collecting trips columns, but I got either errors like attempting to duplicate catalog numbers or existing CE detected as new Cells as soon as I added collecting trip information.
The failure was expected though, since the Workbench is all about
can it be achieved with existing Sp7 tools ?
It is kinda straightforward to to do it from the mariadb prompt by:
creating the Collecting Trip from the Data Entry tab
updating the collectingevent:collectingtrip_id field with a SQL statement
but I feel like I might be making poor use of the existing GUI tool and Iâd rather ask here.
I believe what you are trying to do is entirely possible in v7.10.2.3 using batch edit, you just have to work from Collecting Trip backwards. Since the fields you want to modify are in Collecting Trip, that should be your base table. You can use Collection Objects as part of the query if you need that to filter for records you are looking for. Note in the screenshot below Text3 would be the name field (Trip Name doesnât exist as a caption in the demo instance)
Thanks for the quick and sharp response, as always !
It makes complete sense to base my query on the Collecting Trip table if I where to modify existing fields or add values to empty fields, and narrow down my search with a list of catalog numbers (or any other criteria that would help to identify the group of specimen). But my Collecting Trip table is empty so far (we never used it), so any query based on Collecting Trip table does return Results: (0)
That is why I based my initial query on existing Catalog numbers and added collecting trip fields (expected to be empty).
Ah, yes, I had considered this may have been what you meant later that afternoon. I donât know of a GUI solution in that case, I solved this problem by putting the ability to do it in the edit bot (which will soon hopefully become obsolete!)
The ability to batch edit relationships is slated for v7.11.0 and has been merged (though some bugs remain, I donât think any would affect this), probably best to just wait for that.
@markp is spot onâwhat youâre asking for will be possible as soon as we ship v7.11.0, which should be out in the near future. Right now, neither the WorkBench nor Batch Edit can update the relationship that links Collecting Trips (CTs) to existing Collecting Events (CEs), but that capability is coming in the next release.
The reason this isnât supported today comes down to how the database tables are related. With objects like Citations, Preparations, or Determinations, the foreign key[1] lives on the new record side. For example, each preparation row carries a CollectionObjectID that points back to its parent Collection Object (CO).
Because the link is on the preparation side, you can easily add new preparations to an existing CO through the WorkBench:
Collecting Trips work differently: the link is stored on the Collecting Event side. In other words, the CE record must be updated to point at a different CT. That update requires true batchâediting of the CollectingTripID fieldâwhich, as mentioned, isnât enabled until v7.11.0:
Once the update is out, youâll be able to select multiple CEs and change their CollectingTripID in one go. Weâll keep you posted on the release, and as soon as itâs available you can go ahead and batchâlink those trips!
Hope that helps, and let me know if you have any other questions!
Batch editing truly was the greatest increase to productivity since the steam engine, another round of congrats to the team (perhaps like the people that cheer you on as you approach kilometre 35 of the marathon, the end is in sight!)
Looking forward to seeing this âfeel naturalâ expansion of the Sp7 Batch Edit capability.
I fully subscribe to what Mark wrote down (and flattered to see Denis Papinâs genius acknowledged ). Batch Edit was a long awaited tool in Sp7 and you all worked hard and delivered. Thumbs-up !
In the first post I wrote that it would be easy to do it from SQL prompt. I put it down on paper in case it may help someone not fully confident with the process.
As always when attempting to work directly on SQL database, make a database backup beforehand. Quoting Grant Master :
I first created the Collecting Trip âMission Wallis et Futunaâ from the Data Entry tab (I had to previously edit the Data Entry tab to include the Collecting Trip table, not visible by default)