[英]Zapier Python editor doesn't output anything even though code works in python
I'm trying to create code that matches True/False messages from checkboxes from a form to the checkbox titles.我正在尝试创建与从表单的复选框到复选框标题的真/假消息相匹配的代码。 Whenever the checkboxes are clicked, the titles should be appended to a list that is outputted in the end.
每当单击复选框时,标题应附加到最后输出的列表中。
This is my code:这是我的代码:
def nische(input_data):
nischen = []
for key in input_data:
if input_data[key] == True:
print(key)
nischen.append(key)
if input_data['Sonstiges'] != "":
nischen.append(input_data['Sonstiges'])
string = ', '.join(nischen)
string = str(string)
return string
result = nische(input_data)
output = print(result)
I've tried everything, but the Zapier Interpreter shows no output.我什么都试过了,但是 Zapier 解释器没有显示 output。
this is the zapier output enter image description here这是 zapier output在此处输入图像描述
Your problem is in the last line: output = print(result)
.您的问题在最后一行:
output = print(result)
。
The print
function doesn't return anything (it just prints), so your output
is None
. print
function 不返回任何内容(它只是打印),所以你的output
是None
。
Instead, return your result:相反,返回您的结果:
return {'result': result}
(output must be a dict
, not a string) (输出必须是
dict
,而不是字符串)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.