Skip to main content
Level 4
November 7, 2025
Solved

How to update and replace XML code value in Adobe Campaign using JavaScript?

Hi everyone,

I have a lot of workflows in Adobe Campaign where I need to update and replace a specific attribute with another attribute.

I was wondering if it's possible to use JavaScript to directly update the XML and perform a replace operation. For example, I want to locate [agreementLink/XYZ/@123] in the xml-code and replace it with [agreementLink/ABC/@456] in every row I can find it.

I believe it should be technically possible, has anyone successfully done something similar? Any advice or examples would be greatly appreciated!

Thanks in advance!

ccg1706
ccg1706Accepted solution
Community Advisor
November 9, 2025

Hi @a_b_se, 

 

Yes, you can use JavaScript to directly update the XML. You can query all the workflows that have a specific string in their XML, then replace it with the new value.

 

The process should work as follows:

-Identify all the workflows where the XML contains the target string.

-Stop the workflows

-Replace the old string with the new one in the XML.

-Save the changes and restart the workflows. 

 

You can do the whole process with a simple JS using the xtm:workflow and make sure you develop it on a test environment, keep a backup and then move it to production.

 

Hope it helps! Let me know if you need more guidance.

Best, 

Celia

2 replies

ccg1706
Community Advisor
ccg1706Community AdvisorAccepted solution
Community Advisor
November 9, 2025

Hi @a_b_se, 

 

Yes, you can use JavaScript to directly update the XML. You can query all the workflows that have a specific string in their XML, then replace it with the new value.

 

The process should work as follows:

-Identify all the workflows where the XML contains the target string.

-Stop the workflows

-Replace the old string with the new one in the XML.

-Save the changes and restart the workflows. 

 

You can do the whole process with a simple JS using the xtm:workflow and make sure you develop it on a test environment, keep a backup and then move it to production.

 

Hope it helps! Let me know if you need more guidance.

Best, 

Celia

Translate
A_B_SEAuthor
Level 4
November 10, 2025

Hello @ccg1706 ,

 

Thanks for your reply. Do you have an example of a JS code that works that I can use to test this?

Translate