Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How can I keep commas in an integer?

james_icf
Level 3
Level 3

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?

3 Replies
shrawans3153003
Employee
Employee

HI James,

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

james_icf
Level 3
Level 3

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.

pablo_rosero1
Level 10
Level 10

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