Expand my Community achievements bar.

How can I keep commas in an integer?

Avatar

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?

4 Replies

Avatar

Employee

HI James,

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

Avatar

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.

Avatar

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

Avatar

Level 2

I know it's been a while since this was posted, but did you ever find a non-script solution?