Expand my Community achievements bar.

SOLVED

Dynamic Content in Adobe Campaign: Aggregating Data with JavaScript

Avatar

Level 1

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

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 1

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

 

 

View solution in original post

4 Replies

Avatar

Correct answer by
Level 1

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

 

 

Avatar

Level 1

@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

Avatar

Level 1

Thank you @ÓscarGo for your response.

I have been using this approach in other campaigns, however in this case there is a lot of data and the target schema string field has a limit of 255 characters. I could split the data in multiple fields but it overcomplicate it and I do feel this is not a proper solution. I think this works more like a hack so I wonder if there is a workaround in Adobe Campaign for this case (which is an email marketing basic)

Avatar

Level 1

Hi @DiegoGar 

The best way of doing so, will be to create an email with a link to a landing page where you can easily read Adobe database to print Horses info and also have better/easier UX configuration.

 

BR, Oscar