Trying to add a locality query combo box to the collection object form

Hello, I'm trying to add a locality query box to my collection object form, but for some reason it won't show up.

Hi @fergashl,

Can you share a copy of your form definition XML so that we can take a look?

Thank you!

Sure, is this what you are looking for?

Hi @fergashl,

That is exactly it! Can you save and send us the full XML definition?

From what I can see, it looks like it is defined correctly. Are other changes you make reflected on the collection object form?

Are you using Specify 7 or Specify 6?

At which level are these forms present? They can exist under a user, user type, collection, discipline, or institution.


It also looks like the column definition for Specify 6 on Windows is much different than the others which may be causing an issue:

fossilplantpaleo.views 30Aug2023.xml (93.2 KB)

I can see the other fields, just not the locality for some reason. The form is part of the the fossil plant collection, and we are using Specify 7.

The column data px were changed just because another form was that way and it seemed to be working, but I could see it causing a problem.

Hi @fergashl,

It looks like I missed one important detail in your first screenshot:

It looks like you are just missing the </row> component below the altCatalogNumber row.

  <cell type="label" labelfor="1" colspan="1"/>
  <cell type="field" id="1" name="catalogNumber" uitype="formattedtext" colspan="6"/>
  <cell type="label" labelfor="14" colspan="3"/>
  <cell type="field" id="14" name="altCatalogNumber" uitype="text"  colspan="4"/>
</row> <!-- This row attribute MUST close the first section-->
<row>
  <cell type="label" labelfor="4"/>
   <cell type="field" id="4" name="locality" uitype="querycbx" initialize="name=Locality;title=Locality;clonebtn=true"/> 
  </row>
</row>

Thanks! Figures it would be something simple.
I had another question regarding allowing letters in the catalog number field though. I read through a page on how to change it but I’m not sure how to do it since the directions are for Specify 6.

I fixed the row issue, but the locality still doesn’t show up and now there are two “cataloger” labels.

We recommend connecting to the database using Specify 6 and following this guide:

You may need to work with your IT department to get your computer connected to the database server. You’ll need to copy the master key from Specify 7 to get connected!

image

Another issue is that the ID for locality and for cataloger is the same. Each ID must be unique and not reused. Can you try to resolve this and see if it is working properly now?

I changed the label for the locality to 7. The second cataloger label has disappeared, but the locality field still has not showed up.

Ah– forgive me again. The most obvious thing of all slipped my mind–

The locality field does not exist in the Collection Object table, therefore it will not display. It can only be displayed in the Collecting Event table, which means you need to first have Collecting Event added to the form, then from there you can link to a Locality.

You cannot go straight from Collection Object → Locality.

Ah, I see! I will try that. Thanks!

Would the collecting event field be a query box or a new area like the determination data?

Hi @fergashl,

This depends on the Specify configuration. Collecting Events can be either ‘embedded’ or ‘shared’ depending on how it is set up in your collection.

You can find out by running a query on the Collection table:

https://sp7demofish.specifycloud.org/specify/query/new/discipline/


Since these are not embedded, this means that they are ‘shared’.

‘Shared’ collecting events should be shown as a query combo box.

<row>
    <cell type="label" labelfor="7"/>
    <cell type="field" id="7" name="collectingEvent" uitype="querycbx" initialize="name=CollectingEvent;clonebtn=true" colspan="9"/>
</row>

‘Embedded’ collecting events should be shown as a ‘subview’.

<row>
    <cell type="subview" viewname="CollectingEvent" id="21" name="collectingEvent" colspan="12" rows="5"/>
</row>

Adjust colspan and rows accordingly :smile:

Alright, I guess I am still stuck. I tried running a query to determine if the collecting event is shared or not, but I don’t have a “Is Embedded Collecting Event” option. I looked through the xml code and it does have an option for a subview, so I tried adding it, but the plus and minus next to it are greyed out. Is that because it is shared only? Is there a way to change it so that it would accept a subview?

Collecting Events that are embedded are supposed to be displayed as subviews, but Collecting Events that are shared are supposed to be displayed as query combo boxes.

You cannot easily change from shared collecting events to embedded ones, unfortunately. Since the database already has collecting events shared between multiple collection objects, it would require scripts in SQL to change this.

You can query on fields that are “hidden” in the schema by checking the ‘Reveal Hidden Form Fields’ box in the bottom left of the query builder.

Reveal Hidden Form Fields

Once this is done, you should be able to query on the ‘Is Embedded Collecting Event’ field in the Collection table!

Ah, I got the Embedded field to show up. I see, I will have to ask how the curators would like to proceed. Thank you for the help!