Question

How can I use variables in the "Body" section of the "App Extensions" in Zapier?

  • 24 October 2023
  • 9 replies
  • 131 views

Hi, how can I use variables in “Body” section in “App Extensions”? I tried curly braces {{title}} but it doesn’t work for me. All variables are defined and filled in zap. Thank you

 


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

9 replies

Userlevel 7
Badge +14

Hi @Artem2266 

Good question.

When you select the App Extension action you created in the Zap step, you can then map dynamic variables.

Help: https://help.zapier.com/hc/en-us/articles/16276574838925-App-Extensions-in-Zapier

Variables are mapped, but api request to Klaviyo doesn’t work if I use variables like {{variableName}}, it only works if I put static data instead of variables for testing purposes

 

Userlevel 7
Badge +14

@Artem2266 

Can you elaborate by what you mean for when it does and doesn’t work? (screenshots, errors, etc.)

Okay, let’s simplify my question: does variable in request body supposed to work? If yes - what is the right syntax? Please refer my screenshot: if I put static title - zap works; if I put variable - zap crashes

 

Userlevel 7
Badge +14

@Artem2266

e.g. In the App Ext config, the {{Title}} placeholder value becomes the mapped variable value for the Title field in the Zap step config.

 

 

@Troy Tessalone, it seems that Zapier is not resolving the Variables. Wordpress returns an Invalid Json Body error everytime I add a variable to my body. 
Example:

"expireType":{{expiration_date_type}},

doesnt work, but 

"expireType":"draft",

works completely fine.

I believe that its the same error @Artem2266 is getting.

Error I get when I have a variable in my Body:

Failed to create an app extensions in WordPress
Raw request failed. Problem executing your request: WordPress ran into an issue. Error code 400: Invalid JSON body.

 

Userlevel 7
Badge +14

@jakobbott 

Probably best to submit a ticket to Zapier Support: https://zapier.com/app/get-help

Userlevel 7
Badge +14

@Artem2266 and @jakobbott 

Another option is to try using this Zap action: WordPress - API Request

 

@Troy Tessalone, yeah seams like its time for the Support. 
Because I just wanted the App Extension for easy reusability, Im probably going to go smooth out my prototype Code Action and just go with it. 
Anyway, thank you a lot for the Idea.