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
BedrockMission!

Learn More

View all

Sign in to view all badges

How to add additional field in targetdata using script

Avatar

Avatar
Validate 1
Level 3
ckumari12
Level 3

Likes

17 likes

Total Posts

38 posts

Correct Reply

4 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 3
ckumari12
Level 3

Likes

17 likes

Total Posts

38 posts

Correct Reply

4 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
ckumari12
Level 3

27-01-2021

Hello,

I am working on a requirement where i need to add an additional field 'field1' (not part of recipient or campaign). I need to  use field1 field in target mapping and store this in broadlog (created an custom field to store).

I need to create this field and set its value dynamically because different campaigns/workflow can have different values.

 

I can't do this query activity because the end-user won't be able to do this everytime they select a new query activity and enrich it.

 

What we can do is to set a delivery in initialization script tab of delivery template and then use it in delivery whenever user is configuring delivery using a delivery template.

 

I tried adding below code:

 

sqlExec("Alter table "+ vars.tableName + " ADD COLUMN icampaignFlag INT");

sqlExec("Update " + vars.tableName + " set icampaignFlag =" + 1);

 

But this field is not showing in target data. May be because there is no adobe name for this field.

How can we see this field in targetdata?

 

Can someone help?

 

@Vipul 

@AmitKumar 

 

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
MVP
wodnicki
MVP

Likes

938 likes

Total Posts

1,061 posts

Correct Reply

495 solutions
Top badges earned
Contributor
Shape 1
Give Back 100
Give Back 50
Give Back 25
View profile

Avatar
Contributor
MVP
wodnicki
MVP

Likes

938 likes

Total Posts

1,061 posts

Correct Reply

495 solutions
Top badges earned
Contributor
Shape 1
Give Back 100
Give Back 50
Give Back 25
View profile
wodnicki
MVP

02-02-2021

Hi,

 

Target schema can be altered with js but it's not for the faint of heart. Easier to prepopulate workflow template with query that has mapped field.

If the data doesn't vary by recipient, does it need to be in broadLog?

 

Thanks,

-Jon

Answers (0)