Custom Handlebar helpers

I have a data field labeled ACH_ELECT. That field actually contains four pieces of data I Need to extract separately. It looks like this - 9999 D 123456789 Savings, I created handlebar helpers to extract ‘9999’, ‘123456789’ and ‘Savings’. In my design template this works. I ran a test print in design and I get the result I am expecting. When I run it through workflow, which is a basic workflow nothing special, my custom handlebars do not display. The fields are blank. So I have three custom helpers pulling a piece of the one data field. Do you know why it won’t show the results through workflow but does in designer? I have my helper script in the scripts panel. I have five scripts and all work except the custom ones.

Thank You

Did you add the custom helpers to a control script?

Yes - I right clicked and then clicked on handlebars text helper.

When Workflow and Designer show different result, the culprit is ususally one of those 2:

  • The version of the Template used in Designer differs from the one called by Workflow.
  • The testing data is different in the Designer VS the one used in Workflow.
    – For this one, also check any manipulation done on the data in Workflow before it is passed to the Datamapper.

Make sure you check both.

Hi - the workflow and designer are both 2026.1. Also, I am using the same data file in designer as I am testing with. There is no manipulation. Here are the custom scripts I am using. These work great in designer and I get the results I should. I double checked to make sure I was using the helpers correctly and everything spelled and capitalized correctly.

// GETTING THE CHECKING ACCT # - LAST FOUR DIGITS
Handlebars.registerHelper(“getACHACCT”, function(value) {
if (!value) return “”;
return String(value).split(" ")[0];
});

//GETTING THE ACH #

Handlebars.registerHelper(“getACHNumber”, function(value) {
if (!value) return “”;

var parts = String(value).split(" ");
return parts[2] || "";

});

//GETTING ACCOUNT TYPE
Handlebars.registerHelper(“getACHType”, function(value) {
if (!value) return “”;

var parts = String(value).split(" ");
return parts[3];

});

I suggest that you add logging to the helper scripts to check if they are called, and what values get passed in.

Perhaps temporarily add an expression for the original data field to the page and see if that appears in the output generated by Workflow. That way we know the data is there.

I was talking about the version of the Template, not the one of the Connect you are using (although that is also a good thing to check but you already did.

Just make sure that whatever Template you use in the Designer is the exact same one used in Workflow.

To be on the safe side, go to C:\ProgramData\Objectif Lune\PlanetPress Workflow 8\PlanetPress Watch\OLConnect\Template, delete the Template and folder named after the Template you are using and resend the Template to Workflow after that.