Help with Custom Object Velocity Script

SimranNaidu_
Level 1

Help with Custom Object Velocity Script

We're attempting to make the body text dynamic using a velocity script that references a custom object on the SFDC Practice table. However, the script isn't yielding any output. The fields we're referencing are checkboxes (as shown in the screenshot). We suspect that the issue might be because we're using fields on the practice table (custom object) or because they are checkbox fields. Our theory is either correct, or there's an error in how we've written the velocity scripts (see the scripts labeled Velocity Script 1 and Velocity Script 2 below). We've tried using both 1/0 and True/False values in the script. 

Could you confirm if our theory is correct? If not, could you assist with correcting the velocity script?

 

Script 1 -

#if(${Practice__cList.get(0).meets_availability_threshold__c})

availability

#elseif(${Practice__cList.get(0).meets_insurance_threshold__c})

insurances

#elseif(${Practice__cList.get(0).meets_visit_reason_threshold__c})

visit reasons

#else

more budget

#end

 

Script 2 - 

#set($availabilityThreshold = ${Practice__cList.get(0).meets_availability_threshold__c})

#set($insuranceThreshold = ${Practice__cList.get(0).meets_insurance_threshold__c})

#set($visitReasonThreshold = ${Practice__cList.get(0).meets_visit_reason_threshold__c})

 

#set($bodyText = "")

 

#if($availabilityThreshold)

#set($bodyText = "availability")

#elseif($insuranceThreshold)

#set($bodyText = "insurances")

#elseif($visitReasonThreshold)

#set($bodyText = "visit reasons")

#end

 

${bodyText}