How to render the boolean field

LabKey Support Forum (Inactive)
How to render the boolean field Jon (LabKey DevOps)  2015-04-20 21:04
Status: Closed
 
Thanks Feifei,

So I did find another way to do this. It isn't exactly what you asked for, but it is close.

This requires you to do the following:

1. Create a new query off of your existing list via the Schema Browser. To create a new query, just select your list in the schema browser and click on "Create New Query".
2. In your new query, you will want to do the following:
   - Add the Primary Key field to your query or whatever field is going to be used to identify the specific record
   - Update the boolean field to use a CASE. See my example below:

SELECT TestBool.Key,
TestBool.Name,
CASE WHEN TestBool.download = false THEN 'Variant Selection' ELSE 'Download Report' END AS url
FROM TestBool

The query above is tied to a basic list that just has the Key value, a name field, and a download option that appears as a checkbox to do the boolean value. The CASE will use the words "Variant Selection" if the download is false and "Download Report" if it's true.

3. After the query is saved, you will update the XML Metadata for the field where the case is being used ("url" in my example). So you will go into the Edit Metadata section of the query and add the following to the URL field that corresponds with the boolean field:

/labkey/project/Feifei%20Project/GeneProject/begin.view?pageId=${url}&recordId=${Key}

This will then create a query off of the list and it will be a link to a specific page (Variant Selection or Report Download) based on whether it's true or false and it will also pass along the ID of the record in the list.

Does this make sense?

Regards,

Jon