Using Aliases for Sample Types

LabKey Support Forum
Using Aliases for Sample Types ophira  2021-08-15 04:24
Status: Closed
 

Hi,

We created several Sample Types in our Community Edition Labkey Server.
In one of our Sample Types, each row has its own Name which is determined by us during upload, say HA_###.
There is also the Alias field, where we can use to have a more meaningful name, which we can also change without changing the row's Primary Key.

A few questions about this:

  1. can multiple Aliases be assigned to a single row? on first glance it seems that only one Alias can be assigned to a single row. If this is impossible, we can of course concatenate different aliases to a single value ("alias1;alias2")
  2. are there any "special" traits to the Alias field? for example, I noticed that it's not unique, so two rows can have the same alias. I didn't find a lot on this topic in the Documentation, perhaps I missed something.

Thanks,
Ophir

 
 
Jon (LabKey DevOps) responded:  2021-08-19 15:51
Hi Ophir,

I'd like some clarification on your questions.

- Why would a row have more than one alias?
- What are you looking to do here with regard to the Alias field?
- What part of the system are you working in specifically? There are a few other places where "Aliases" are used, so screenshots would be very helpful in providing you with accurate information.

When it comes to aliases as described here under the "Name and Linking Options" section:

https://www.labkey.org/Documentation/wiki-page.view?name=fieldEditor#alias

"Import Aliases: Define alternate field names to be used when importing from a file to this field. This option offers additional flexibility of recognizing an arbitrary number of source data names to map to the same column of data in LabKey. Multiple aliases may be separated by spaces or commas. To define an alias that contains spaces, use double-quotes (") around it. Learn more about import aliases."

The purpose of an Alias is to be able to import a value under a column that has a different column name.

For example, let's say you're calling a particular column "ParticipantId" in your CSV file that you want to import in, but your actual list/dataset/etc has "SubjectId" instead. Rather than you having to go into the CSV file to change "ParticipantId" into "SubjectId", you can assign an Alias to that field in LabKey so it will understand that upon import of the file "ParticipantId" is the same thing as "SubjectId".

Another example is where you might have a CSV file where the column header is labeled "Sex", but your table in LabKey is set to "Gender". You can add "Sex" as an alias to the "Gender" column so you wouldn't have to revise the CSV file.

Regards,

Jon