Skip to main content
Best answer

Webflow checkboxes true/false value to text.


Hello,

I receive form data from webflow. One of the question has multiple choices, so I’m using checkboxes. On Zapier it returns name of the checkbox and it’s value is either true or false.


I need to send this info to Pipedrive and assign to specific field and for that I need it’s name. I figured custom js code would work but I’m having a problem. I’m trying to asign it’s value to seperate variables and depending if they true or false, give them their according names. Like this: 
(It’s exact copy that I wrote in Zapier custom code. Just copied in VSCode so I could take a good screenshot)

Problem is that even though only first choice is true, code is acting like all choices are true and are givin names to all answers. This is the output:



Why is this happening. I’m pretty sure that in normal environment only first answer would have a string, other’s would be empty value. 

What am I doing wrong? 

Best answer by Troy TessaloneBest answer by Troy Tessalone

@Amal_Emifast 

Yes, when passed into a Code step as an input.

Help: https://zapier.com/apps/code/help

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Troy Tessalone
Forum|alt.badge.img+14

Hi @Amal_Emifast 

Your code logic is checking if there is a value for the choices.

The choices will always have a value. (true or false)

You need to further specify the if condition to check if the value == true.

 

 

Also, try asking ChatGPT for help optimizing/commenting your code.


  • Author
  • Beginner
  • 1 reply
  • January 30, 2024

Hello, @Troy Tessalone.

Thank you for a quick answer. The thing is that I tried that before and it still didn’t work.

Now I tried like this choice1 === ‘true’ and it works perfectly, but I don’t understand why? Does Zapier registered returned true/false booleans as strings?  


Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 30939 replies
  • Answer
  • January 30, 2024

@Amal_Emifast 

Yes, when passed into a Code step as an input.

Help: https://zapier.com/apps/code/help