Naming_Pattern in Sample_Type_Properties getting "invalid substitution token" message

LabKey Support Forum (Inactive)
Naming_Pattern in Sample_Type_Properties getting "invalid substitution token" message mohara  2025-01-21 15:36
Status: Active
 

Hi Christopher:

In that image, it looks like you're attempting to edit the naming pattern for the Source Type to be the ${SourceId} which would be both ambiguous and will not generate unique names going forward even if you manipulated the fields so that worked. What I think you meant to do is to edit the Sample Type's naming pattern to include the SourceId (aka Name) of the source.

It sounds like you'd already successfully created some sources of that type, let's say TestA, TestB, etc. - so your next step will be to edit (or create) the Sample Type's naming pattern to include it. There are a few ways to do so, one simple one is to include a source in the sample type properties. You provide a "file import column name" (aka a source alias) that you can then use in your naming pattern.

For example, edit the Sample Type and add a source of type "Test01", using "TestSourceId" as the alias/import column name. If you just use a simple counter as the "barcode" element, then your naming pattern could be like this -
S-${TestSourceId}-${genId}

To get names similar to this:
S-TestA-1
S-TestA-2
S-TestB-3
S-TestB-4

There are lots more ways to incorporate lineage, different counter patterns, and more options for sample naming patterns in the documentation.

Hope that's helpful,
--Molly