Batch update personalization blocks through a workflow or other method? | Community
Skip to main content
Level 2
March 12, 2025
Solved

Batch update personalization blocks through a workflow or other method?

  • March 12, 2025
  • 2 replies
  • 1164 views

Looking for guidance on how to best import our html email headers and footers into adobe campaign as personalization blocks. We have 100+ of each and I do not want to manually copy and paste html code into Adobe Campaign.

 

I was hoping I could do something where I place the html in a folder on our SFTP and then have a Workflow import them as personalization blocks but open to anything really.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Hurston

I ended up making a lot of changes and then after some time I found that it was failing because I was running the workflow in the Web UI. Running it through the Desktop application everything worked as expected. 

2 replies

_Manoj_Kumar_
Community Advisor
Community Advisor
March 12, 2025

Hello @hurston  You can update the default delivery template to have the headers and footers. This way any new delivery will already have those PB populated by default

     Manoj     Find me on LinkedIn
HurstonAuthor
Level 2
March 12, 2025

Thanks, but my question is more so how do I actually get my headers and footers into Adobe Campaign without having to manually copy and paste the html int the personalization blocks for 100+ files.

_Manoj_Kumar_
Community Advisor
Community Advisor
March 13, 2025

Hello @hurston  Here is what you can do.

Write a JS code in workflow to read the HTML files from SFTP server and then add the code to dynamically create the PB.

 

Sample Code:

function createPB(pbContents,label,internalName){ var newPB=nms.includeView.create(); newPB.Duplicate('nms:includeView|2029'); // 2029 is the primary key of an existing shared PB newPB.source.text=pbContents; newPB.name=label; newPB.name=internalName; newPB.save(); } var FOLDER_PATH=""; // PATH of your folder that contains HTML files var FILE_NAME_PATTERN = "*.html"; //pick only HTML files var objDirectory = new File(FOLDER_PATH); var objFiles = objDirectory.list(FILE_NAME_PATTERN,false); for each(var objFile in objFiles){ var PersonalizationBlockName=objFile.name.replace(".html",""); //Get file name and remove .html then use the as label of PB var htmlFile=new File(FOLDER_PATH+objFile.name); htmlFile.open(); createPB(htmlFile,PersonalizationBlockName,PersonalizationBlockName); htmlFile.close(); htmlFile.remove(); // this is to delete the file once it is processed. }

 

This code is not tested and is just for guidance. DO NOT USE IN PRODUCTION.

     Manoj     Find me on LinkedIn
Sukrity_Wadhwa
Community Manager
Community Manager
April 2, 2025

Hi @hurston,

Were you able to resolve this query with the given solution or was this something you were able to figure out on your own or do you still need help here? Do let us know.

Thanks!

Sukrity Wadhwa
HurstonAuthorAccepted solution
Level 2
April 2, 2025

I ended up making a lot of changes and then after some time I found that it was failing because I was running the workflow in the Web UI. Running it through the Desktop application everything worked as expected. 

Sukrity_Wadhwa
Community Manager
Community Manager
April 16, 2025

Thanks for sharing the update!

Sukrity Wadhwa