Best answer

issue passing variables to python

  • 6 March 2023
  • 4 replies
  • 183 views

Userlevel 1

I have a zap that processes json data into a python script. when I assign the input data you can see that there are null values in the string. This is good and expected, but when it gets to the code the null values are removed. I have tried replacing the “,,” values with “,null,” but because the “,,” values are stripped out before the code runs this does not work. I think this is an issue with the code functions in zapier.

 

 

icon

Best answer by Troy Tessalone 7 March 2023, 00:28

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

Userlevel 7
Badge +14

Hi @Dan0nator 

Good question.

Try this workaround…

Use a Formatter > Utilities > Line Items to Text step first.

You can use that to combine arrays into 1.

e.g. [ARRAY1]|||[ARRAY2], which will handle the nulls.

Then you can pass that into the Code step and handle it better.

Userlevel 1
The input shows the blank leading fields
the output has removed it.

 

Userlevel 7
Badge +14

@Dan0nator

Try something like this…

 

Array with null values.

 

 

Formatter > Utilities > Line Items to Text

NOTE: Set a static value to join

 

Then you can handle the TEXT output how you want into the Code step.

 

Userlevel 1

@Troy Tessalone that did the trick. I added “value “ and in my python code im just doing text matching so that additional word did not impact the code so it is working fine now. Thanks for the help.