ViewName selection on survey lookup option

LabKey Support Forum
ViewName selection on survey lookup option jenica abrudan  2023-04-05 07:09
Status: Active
 

I have multiple survey fields where i need to select a lookup value from a list. Since the value sets a slightly different i am using viewName as in (https://www.labkey.org/Documentation/wiki-page.view?name=questionMetadata#viewName) but while this works for the first field - all subsequent fields have the same viewName applied even if the other fields have different viewName defined on the lookup.
Can different survey fields on the same survey use different viewName for subselecting values from the same lookup list ?

 
 
mohara responded:  2023-04-05 13:25

Hi Jenica:

Thanks for reaching out. You're right that only a single viewName for a given list is supported in a survey. I'm not sure if this is intentional, but I can reproduce this locally trying to use two different "viewName" settings for different filtered views of one list for two different questions. Only the "first" one applies to both questions.

A good workaround for this scenario would be to create individual queries over the list and do the filtering there for each question's expected values, so that each survey question would be looking at a single (prefiltered) query instead of trying to filtering the same list 'on the fly'. Hope that helps.

If you need additional assistance, we can follow up on your Premium Support Portal.

--Molly