Logic_Hooks: finding if a checkbox is clicked

I’ve used workflows before and I liked them up until I had logic that included a lot of different conditions, so now I’m rewriting the calculation in a custom PHP file. The way that I know about seeing if a checkbox is set uses javascript alongside with php, and I was wondering if there is a way to do it purely in PHP. this is my php file set-up. I’m not sure if checkbox values are easily accessible in Beans so there may be an easier answer than I thought.

if($bean->turnoffcalculation == ???){
//check ‘turnoffcalculation’ checkbox for if it’s selected
}

Hey,

Yeah, you should be able to access the value through beans, something like the following should hopefully work:
(‘checkme_c’ is a custom checkbox field I have created)
image

The checkbox values are stored as a 0/1 typically

So, in the example above,
If the checkbox is ‘TRUE’ or ‘1’, (ie Checked in the CRM), the description will be updated to “Checked!”

Or, if you wanted to invert and check if checkboxes are unchecked, you could just add a “!” character, ie:
image

Is that what you’re looking for?

2 Likes

Cool! Thanks it works

Great,
Glad to hear it!

1 Like