query based on list that has file attachment columns does not render attachments normally

LabKey Support Forum (Inactive)
query based on list that has file attachment columns does not render attachments normally Ben Bimber  2011-06-08 11:53
Status: Closed
 
i have a list where one column has a type of file attachment. when you load this list in labkey, that column renders with the file icon and it is a link to download the file. if i write this query:

select * from lists.myTable

then the file columns render normally. if i do:

select column1, fileColumn from lists.myTable

then the file columns render with the file icon, but they are not links to download the file. should I do writing the second SQL differently? the reason I do not want select * is two-fold. first, I'm writing this second query so that users cannot see some of the original columns, even if they try. second, 'select *' causes normally hidden column to stop being hidden.

thanks.
 
 
trent responded:  2011-06-08 18:32
It seems to me that you need to select entityId in order for the link to the image to work. My guess is when you don't select the value, it doesn't know how to build the link so doesn't (as entityId is one of the query string parameters, if you look at the URL).

So in order for the link to work, just select that column. Then hide it by customizing the view, and saving it as the default.