Skip to main content

I'm catching a raw webhook and process this input in a Python Code-step. However,  I didn't succeed in using the returned value from the Code-step in a next step.

The provided Python examples don't show screenshots of Zapier, so I still don't know what to do in order to get the data in the next step.

In the code-step I return the right json encoded value

Hi @MarcKraak 

Good question.

Check out this related help article with Python examples: https://help.zapier.com/hc/en-us/articles/8496197130893-Python-code-examples-in-Zaps

 

Introductory Examples

Each of the four examples below expects a name in the "Input Data" field.

A easy example might be something as trivial as:

return {'id': 1234, 'hello': 'world!', 'name': input_datat'name']}

You can also bind the result to output—the code above has exactly the same behavior as the code below:

output = {'id': 1234, 'hello': 'world!', 'name': input_datad'name']}

An example with an early empty return might be something as trivial as:

if input_datad'name'] == 'Larry':
return u] # we don't work for Larry!

return {'id': 1234, 'hello': 'world!', 'name': input_datad'name']}

 


Hi @MarcKraak!
 

Can you post a screenshot of your Python script or copy/paste it into a code window here? That will help us diagnose what’s going on. My guess is it has to do with your return/output statement syntax.


Hi, my Python script contains following 

 

rawdata='<json string........>'
jsonEncodedData = json.loads(rawdata)
# some modifications are done to this json object
output = jsonEncodedData
return output