SOLVED

Re: Checkbox form fills & campaign triggers: How to differentiate between TRUE and NONE when there's no data change?

Go to solution
lukea
Level 3

Checkbox form fills & campaign triggers: How to differentiate between TRUE and NONE when there's no data change?

Hi there,

 

My challenge: I've got a form with a checkbox field F, and I want to timestamp each form submission where F is ticked. The challenge is to do so when F is already "True" in the database. That is because afaik neither a form submission with BLANK, nor one with TRUE will trigger a "Data Value Changed" event, and a smart campaign's smart list trigger can also not check for form field values. Therefore, it's currently either timestamping both (= submitted form trigger, and F is TRUE), or timestamping none.

 

Question: How would you tackle this efficiently? I.e., for a person with F being TRUE in the database, how would you trigger upon a form fill with F again being TRUE and NOT on form fills with F being BLANK?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Checkbox form fills & campaign triggers: How to differentiate between TRUE and NONE when there's no data change?

You're mistaken about one part here. A Marketo Checkbox type field can never send a blank value. It always sends the string "yes" or the string "no". So while it's true that a blank value wouldn't update the database, a Checkbox can't generate such a value.

The other part of your question makes sense. I would use the code here: https://nation.marketo.com/t5/product-blogs/saving-the-last-form-post-all-fields-to-a-textarea/ba-p/...

That will give a you a single field that always changes and contains the "yes" even of it was already "yes".

View solution in original post

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Checkbox form fills & campaign triggers: How to differentiate between TRUE and NONE when there's no data change?

You're mistaken about one part here. A Marketo Checkbox type field can never send a blank value. It always sends the string "yes" or the string "no". So while it's true that a blank value wouldn't update the database, a Checkbox can't generate such a value.

The other part of your question makes sense. I would use the code here: https://nation.marketo.com/t5/product-blogs/saving-the-last-form-post-all-fields-to-a-textarea/ba-p/...

That will give a you a single field that always changes and contains the "yes" even of it was already "yes".

lukea
Level 3

Re: Checkbox form fills & campaign triggers: How to differentiate between TRUE and NONE when there's no data change?

Thanks for the prompt reply.

And... yes, sorry.. my bad: for different reasons, F is actually implemented as of type string - mimicking boolean behaviour, with the value set true, false... and blank. 

 

However, I guess this does not change the answer? Which means, it's not possible with Marketo out-of-the-box tools, but you would need to alter the JavaScript as well as the database (-> adding additional textarea fields), right? 

 

Thanks for the link to the code. Looks promising. 🙂

SanfordWhiteman
Level 10 - Community Moderator

Re: Checkbox form fills & campaign triggers: How to differentiate between TRUE and NONE when there's no data change?

Are you saying it's actually a single-line (type=text) input with validation to only allow the strings "true", "false", and ""? Got me wondering what would lead to that implementation. 🙂

Anyway, yes, you can still use the same code to write to a new Textarea field.
lukea
Level 3

Re: Checkbox form fills & campaign triggers: How to differentiate between TRUE and NONE when there's no data change?

It's even a string. Embrace the age of big data. 🙂 Reason is tied to its legacy CRM implementation, and the field sync. But also to the fact that "" has a meaning - a logical/boolean type would not fit as you pointed out above.

SanfordWhiteman
Level 10 - Community Moderator

Re: Checkbox form fills & campaign triggers: How to differentiate between TRUE and NONE when there's no data change?

It's even a string. Embrace the age of big data. 🙂 


Yes, I was asking about the form input type as opposed to the database type. I assume it's a form Checkbox backed by  a database String.

 


But also to the fact that "" has a meaning - a logical/boolean type would not fit as you pointed out above.

Well, a NULLable SQL BIT/BOOL, which is what Marketo uses under the hood, can represent 3 states (0/1/NULL)! But the problem is you can't always differentiate between 0 and NULL at the application layer in Marketo. The storage layer does distinguish.

 

Anyway, I can see why you might have a String instead of a Boolean and try to handle validation yourself so it doesn't have unlimited values.