Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards

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

Avatar

Level 4

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!

2 Replies

Avatar

Community Advisor

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

Avatar

Level 4

Hello @ccg1706 ,

 

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