EntityID vs Container jdutra  2012-06-04 13:48
Status: Closed
 
I have a little program that uses the java api to check if a dataset column is based on a list. If it is, it queries the actual list to find all possible values for the column. When the list is in the same folder as the dataset, this works fine. However, sometimes the list is stored elsewhere. I'm using Study.DataSetColumns to find information about the dataset column. When it's based on a list, and the list is NOT in the current folder, the LookupContainer column is filled in. However, it's not filled in with a container path, but with an entityId. What is the best way to translate the entityId into a path so that I can find the right list?

I know there is a Core.Containers dataset in each folder, which includes the EntityId of that folder and the EntityId of the parent. I guess I could move up the folder hierarchy looking for a match, but I'm wondering if there's a more straightforward way of doing this. Any help is appreciated!

- Jen
 
 
Matthew Bellew responded:  2012-06-04 13:51
Good question. The secret is that you don't have to translate. Anywhere, you can specify a containerPath in the API, you should be able to provide the entityid instead. This is true on the URL as well, by the way.

If you find anyplace this is not true, let us know.

Matt
 
Ben Bimber responded:  2012-06-04 13:52
Hi Jen,

Check out containerFilter:

https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.Query.html

Those are the JS docs, but the same should be available to java code. for example, you could run you query at the project level, then use the containerFilter 'currentAndSubfolders'. you could also use 'allFolders'.
 
jdutra responded:  2012-06-05 06:34
Thank you Matt! That worked perfectly!