Skip to main content

I have a Wufoo form that upon new entries adds a row to a Google sheet. One of the fields in the Wufoo form is a checkbox field, with multiple values. I assign all those potential values to one cell in the sheet, and all values that were checked are passed as a single string. Ex: Value 1Value 2Value 3Value 4…

I want to add a comma + space in between each option checked: Value1, Value 2, Value 3, Value 4… but every way that a try a formatter it doesn’t work. 

Hi, if I understood well you want to leave out unchecked fields to have a string made only of the positive replies. You may solve this with a Code/Python step.

 

Input data:

 

responses // {{at the right map everything just like in your screenshot, but with a comma and no space between each value}}

 

Code:

 

list = input_data[‘responses’].split(“,”)

positive_answers_list = []

for item in list:

  if item != “”:

    positive_answers_list.append(item)

final_output_as_string = “, “.join(positive_answers_list)

return {“Positive Answers”: final_output_as_string}

 

Note: From your screenshot I understand that negative values from your form come through as empty values. Let me know if it’s not the case and I’ll adapt the code :)


Hi ​@dru_nasty 

First, check to see if there is a data point returned from Wufoo that has the list of selected options, instead of individual fields.

If not, then would need to add a comma between each mapped variable in the Formatter step, so the Formatter step can split by a comma.

 


Here’s the data in and data out.


@escalateur.com I tried that code but you’ll see my output is the same, no separation of the checkbox values. Also, if a checkbox isn’t checked, no empty data is sent.


Thanks for trying it! It just feels to me seeing the output that you put all the fields pasted to each other in the input box. Could you try exactly the same thing but by inserting a comma between every mapped value?

This should let the code ignore empty value, separate the existing ones, and returning a comma + space separated string.


@escalateur.com that worked great, thank you! 

@Troy Tessalone I apologize, i didn’t realize i could manually add commas within the wufoo inserted data. Felt like i tried it before and it didn’t work, but anyway I’m good to go.


That’s awesome ​@dru_nasty! A huge thanks to everyone who lent a hand here.

If you have any other questions, please don’t hesitate to reach out to the Community. We’re always happy to help! 🤗