Dynamic Content in Adobe Campaign: Aggregating Data with JavaScript | Community
Skip to main content
DiegoGar
February 26, 2025
Solved

Dynamic Content in Adobe Campaign: Aggregating Data with JavaScript

  • February 26, 2025
  • 1 reply
  • 716 views

Hi everyone,

I'm working on an email campaign where I need to display a list of horses owned by each user along with their info. I have two tables: one with unique horse owners and another with all the horses. My goal is to send a single email to each owner that includes a table listing all their horses and their data.

What would be the best approach to do this in Adobe Campaign?

 

Horse OwerHorse NameHorse BirthdayGenderRace
test@test.comvera3/5/2002MerrieKWPN
test@test.comAgga3/4/2002MerrieIJslander
test@test.comStor fra Flettuvollum12/5/2002MerrieIJslander
test@test.comDroopy4/30/2008RuinShetland pony
test@test.comCaspar8/1/1994RuinHaflinger
test@test.comPolly1/1/1990MerrieWelsh pony
test@test.comWavottie1/1/2004MerrieKWPN
test@test.comRamona1/1/1999MerrieKWPN
test@test.comDaisy1/1/2000MerrieOverig

 

Thank you

Best answer by ÓscarGo

Hi @diegogar 

You can create a custom field in the target schema of the workflow where you append Horse Names per recipient using a special character as separator:

 

RecipientHorse_Names_custom_field
1Vera|Polly|Daisy
2Ramona|Wavottie
3Caspar
4

Agga|Droopy|Stor

 

You can create this custom field via Javascript activity by querying the target schema using the QueryDef function.

 

Then, in the delivery you can use the targetData.Horse_Names_custom_field and via substring format a list.

 

Hope it helps,

BR Oscar

 

 

1 reply

ÓscarGoAccepted solution
Level 2
February 27, 2025

Hi @diegogar 

You can create a custom field in the target schema of the workflow where you append Horse Names per recipient using a special character as separator:

 

RecipientHorse_Names_custom_field
1Vera|Polly|Daisy
2Ramona|Wavottie
3Caspar
4

Agga|Droopy|Stor

 

You can create this custom field via Javascript activity by querying the target schema using the QueryDef function.

 

Then, in the delivery you can use the targetData.Horse_Names_custom_field and via substring format a list.

 

Hope it helps,

BR Oscar

 

 

Level 2
February 27, 2025

@diegogar 

In the case you want to use the whole Horse info, you can do this:

 

RecipientHorse_Names_custom_field
1Vera,3/5/2002,Merrie,KWPN|Polly|Daisy
2Ramona|Wavottie
3Caspar
4Agga|Droopy|Stor

 

Using more than one separator and then processing it