Highlighted

How can I keep commas in an integer?

james_icf

17-05-2018

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?

Replies

Highlighted

shrawans3153003

Employee

17-05-2018

HI James,

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

Highlighted

james_icf

18-05-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

1490150_pastedImage_0.png

2. Data being loaded

1490151_pastedImage_1.png

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

1490152_pastedImage_2.png

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

1490156_pastedImage_3.png

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

1490157_pastedImage_5.png

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.

Highlighted

pablo_rosero1

28-11-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