How to add code to XML webhook (beginning and end of the webhook)

  • 22 February 2022
  • 3 replies

Hi all!,


From a woocommerce environment, i'm sneding webhooks to another system. I've set the data to XML but the XML file isn't valid. I would like to add some tags to the beginning and the end of the XML file.


How can I perform this?

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

3 replies

Userlevel 7
Badge +12

Hi @Frank Abena 

Can you describe what is invalid?

I am assuming you have the XML as text? If so, you could use a code block to make the insertions or try to use Zapier’s Split Text Formatter. Splitting the XML file where you want to add additional tags. 

If you truly only need to add at the very beginning and the very end you may just be able to wrap the 


If you have an actual XML File and not the text you may need to get more creative. 



I only want to add a tag at the beginning and a tag at the end of the file.


I can’t find out how to do this. Can you explain?


I found out like this: but how can i get all of the variables inside these tags?




Userlevel 7
Badge +12

I am not sure what variables you are referring to

{{XML TEXT}} is not what you should insert but just meant as a guideline for the actual field from your trigger that contains the xml. If you don’t have the XML text and you just have a file that contains the XML then you would first have to get the text out of the file. 

Once you have the raw text in the XML you can then manipulate it.