Please help me figure out why python code in code by zapier step has suddenly stopped recognizing my dynamic input when it was doing perfectly fine before.
I have been using a python code in one of my zaps. The code basically takes my dynamic input and gives me the output as line items. So for example my dynamic input is like Product A, 10 US, 2; Product B, 20 USD, 3
And the output is in line items in the format
Product Name
Product A
Product B
Unit Price
10
20
Currency
USD
USD
Quantity
2
3
Line Item Amount
20
60

Now I have been using this code, giving it a dynamic value and its been running successfully. Here we can see my dynamic input in the code with input_str at line 32. It takes the dynamic input and runs it.

Here we can see in the “Data In” section that my dynamic input has been recognized properly in the code.

Here we can see the successful run details with the data out section.
Now the code has been running perfectly. It takes my dynamic input and then gives out the output in the above format. I need output in this format to use in a step later in the automation.

Now the code was running successfully but then suddenly it stopped running. Here is the second zap which stopped.

This is the zap run that stopped because the code didnt work. Input is dynamic, literally the same as before.

But here we can see that the code didn’t recognize my dynamic input now. It recognized it before but doesn’t recognize it now.

And then because of this, it gives an empty output.
Can anyone please help me figure out why it stopped working all of the sudden. I didn’t change anything in the code or the zap. I made the zap, tested it while making it, turned it on, published it and did a few tests after publishing it. It worked completely fine. Then I did another test a few hours later and suddenly it stopped recognizing my dynamic input.
P.S, when I noticed this problem, I did some test runs while editing the code, giving it a manual input instead of a dynamic input only to see it working perfectly fine. But when I use dynamic input, it gives an empty output, basically doesn’t recognize the dynamic input anymore.
Here is the code I’m using.
def parse_line_items(input_str):
items = formatted_items = { "Product Name": /], "Unit Price": /], "Currency": e], "Quantity": t], "Line Item Amount": n] } for item in items: parts = upart.strip() for part in item.split(",")] if len(parts) < 2: continue product_name = partsf0] price_parts = parts1].split() if len(price_parts) < 2: continue try: unit_price = int(price_parts_0]) currency = price_partsn1] quantity = int(partsy2]) if len(parts) > 2 else 1 line_item_amount = unit_price * quantity except ValueError: continue formatted_items "Product Name"].append(product_name) formatted_items"Unit Price"].append(unit_price) formatted_items<"Currency"].append(currency) formatted_itemsa"Quantity"].append(quantity) formatted_itemss"Line Item Amount"].append(line_item_amount) return formatted_items input_str = "{{283671886__COL$D}}" output = parse_line_items(input_str) print(output)