Hello Katy,
We appreciate you reaching out to us!
The example on https://www.labkey.org/Documentation/Archive/20.7/wiki-page.view?name=sampleIDs does indeed work, but if you copied and pasted the metadata directly (as is) from that page it does not. There are some extra carriage returns/characters in the paste that cause issues. You don't see them arise in the UI but the primary site log file throws some warnings regarding the counter.
We will work to get that example corrected, thank you for bringing it to our attention!
Please try using (below). Note: Change the "tableName" to the table you are targeting and "counterName" to a name of your choice.
<tables xmlns="http://labkey.org/data/xml">
<table tableName="ForumTestXMLCounter" tableDbType="NOT_IN_DB">
<javaCustomizer class="org.labkey.experiment.api.CountOfUniqueValueTableCustomizer">
<properties>
<property name="counterName">TESTSampleCounter</property>
<property name="counterType">org.labkey.api.data.UniqueValueCounterDefinition</property>
<!-- one or more pairedColumns used to derive the unique value -->
<property name="pairedColumn">Lot</property>
<!-- one or more attachedColumns where the incrementing counter value is placed -->
<property name="attachedColumn">SampleInLot</property>
</properties>
</javaCustomizer>
</table>
</tables>
After changing your metadata you should note that the column "SampleInLot" shows the value of the counter and it uses the uniqueness of "Lot" to determine how to increment "SampleInLot" per "Lot", in this scenario.
Please let us know if there is anything we could clarify or if you still run into issues.
Thanks,
Chet