Hi,
I have built a Zap that’s trigger when a new form submission is sent from Jotform.
The output data from Jotform is sent as a text string looking like this:
Artikel 1: Artikelnamn = C5860, Artikelnummer = JGF67458, Antal = 1, Inpris = 75000, Artikel 2: Artikelnamn = Finisher extern, Artikelnummer = 234341, Antal = 1, Inpris = 16000, Fraktartikel: Artikelnamn = Frakt, Antal = 1, Inpris = 2450, Utpris = 2450, Retur: Artikelnamn = Retur, Antal = 1, Inpris = 800, Utpris = 800
In the next step in my Zap I want to create a database item in Notion. I want to populate different properties with data from the output above. So I have in property for “Artikelnamn”, one for “Artikelnummer” and so on.
To mange to do this I’ve use the Code by Zapier and I’m using the following code:
# Check if the input_data contains a dictionary with an 'input_text' key
if isinstance(input_data, dict) and 'input_text' in input_data:
# Get the input text from the 'input_text' key
input_text = input_data 'input_text']
else:
# Otherwise, assume the input_data is a string and set input_text to that value
input_text = str(input_data)
# Use regular expressions to replace square brackets, quotation marks, vertical bars, curly brackets, single quotes, colons, Artikel, and artikelnamn with a space
import re
output_text = re.sub(r'(\>|\]|"|\\|\/|\||\n|\r|{|}|:|\')|(Artikel|artikelnamn)', ' ', input_text)
# Set the output value of the 'output_text' field to the modified text
output = {'output_text': output_text}
When I Manually run all the steps in my Zap it works just fine. The text is split the way I want to and the database item is created in Notion just the way I want it to.
However, when I turn on the Zap and it runs automatically it doesn’t work the way I want it to. The output data isn’t the same. My Zap adds text to the out put data
What am I missing?
Regards Joel