Skip to main content
Question

Code by Zapier - Javasctipt: Input variable is empty in Production - Works perfect in draft-mode

  • November 15, 2023
  • 5 replies
  • 79 views

Hey guys
I’m using a small javascript-step to check a field of new Gravity Form entries. 

The forms are on a Wordpress-Site with two languages. The data is triggered correctly in Zapier and it just works fine, when the form is sent from the main language. If it’s sent from the second language, which is translated with WPML, the script errors because of missing input-data: 

 

 

 

But anyway I can see the data in “Step details”:

 

If I open the exact same form entry in the draft and execute the script manually, everything works without any problems.

 

Does anyone know of this or a similar problem? 
Thx in advance and best regards, 
Daniel

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

5 replies

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • November 15, 2023

Hi @dan28 

Good question.

Can you post screenshots with how the Code is configured?

 


  • Author
  • New
  • November 16, 2023

Hey @Troy Tessalone

Sure… This is the input-configuration:

 




And here the code: 
 


Let me know if I can provide more details. 


 


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • November 16, 2023

@dan28 

Check your Zap Runs history to see the DATA IN/OUT for each Zap step to help you troubleshoot.

https://zapier.com/app/history/

 

 

 


  • Author
  • New
  • November 17, 2023

Hi Troy, 

I have now tried a few workarounds. With "Lookup Spreadsheet row" the error is exactly the same.

It seems that it is the metadata from the form that fails on the first run when the form comes from a translated page. All "normal" fields are submitted correctly. 

 

Example: 
 

I use a pathrule to check a part of the URL.

 
When running in production mode, this value is always empty.
When starting the zap manually, it works normally. 



 


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • November 17, 2023

@dan28 

Sometimes the data points are named/nested different when testing a Zap vs running a Zap live.

That may be impacting the mapped variables between Zap steps.