How can I keep commas in an integer? | Adobe Higher Education
Skip to main content
james_icf
Level 2
May 17, 2018

How can I keep commas in an integer?

Hello, I am using adobe campaign v7.

When I preview some data in the worktable, it has a comma separating thousands because that is how I defined the data load to format the data. However, when I get the delivery and populate said integer personalization field, the commas are gone. Is there way to fix this within the workflow, and not in the delivery itself?

Ce sujet a été fermé aux réponses.

1 commentaire

ShrawanSaxena-1
Adobe Employee
Adobe Employee
May 18, 2018

HI James,

Could you please provide some more details along with screenshot highlighting the issue and what is your requirement.

james_icf
james_icfAuteur
Level 2
May 18, 2018

Hi Shrawan,

My goal is to have some integer field in the working table and have it display in the delivery (email). However, when I populate the delivery with an integer field it does not show with commas. (e.g. The delivery will display 123456 instead of 123,456) I know that I could write some JS within the delivery to format this value, but is there a way to do this in the workflow for all records, versus doing for every delivery in preparation?

Here is a simple example.

1. Overview of WF

2. Data being loaded

3. In the data loading step I have declared that I want the thousands to be comma separated for the "intChange" field

3. Loaded data is reconciled to the nms:recipient data as expected

4. I add an email delivery object and place this code to display the field

<%= recipient.targetData.intChange %> (I know they're tecnically the same, but I also displayed targetData.intChange)

5. I run the workflow to prepare the delivery and preview with live target data, and this is the final deisplay

Q: So, How could I get it to pass 123,123 for this specific record within the WF instead of the current 123123?

Note: I would like to keep it as an integer until the very end so that I can do whatever calculations necessary on that field as well, but at the end it doesn't matter if some sort of string conversion had to take place.

pablo_rosero1
Level 9
November 29, 2018

Hi James,

I'm not sure about this one. A possibility is to update with an activity as part of the workflow with Content Management. See Action activities​. Here's how to create a Javascript template for Formatting​.

I hope this helps!

All the best,

Pablo