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

The 4th edition of the Campaign Community Lens newsletter is out now!
SOLVED

Update/Insert a value to a field when importing a list

Avatar

Level 4

Hi,

I have two questions.

  1. If there any way to update or insert a value to a field when importing a list. The value will look like "ABC_GetDate()", so the final value will be "ABC_8/18/2018".
  2. When deploying a campaign, In the Query window, can I set query to: A field name equal to "ABC_GetDate()" to get the above the record.

Thanks,

Jason

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi Jason,

Use a JS code activity to create your custom data. Add the following line of code

instance.vars.customData = "ABC_" + formatDate(new Date(), "%2M/%2D/%4Y");

1552225_pastedImage_1.png

Then connect this JS code activity to your query activity or an Enrichment. Add a new column and use the formula

= $(instance/vars/@customoData)

1552232_pastedImage_2.png

When trying to filter thiis data you the condition as

'ABC_' + Month(GetDate()) + "/" + Day(GetDate()) + "/" + Year(GetDate())

1552233_pastedImage_3.png

Regards,
Vipul

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

Hi Jason,

Use a JS code activity to create your custom data. Add the following line of code

instance.vars.customData = "ABC_" + formatDate(new Date(), "%2M/%2D/%4Y");

1552225_pastedImage_1.png

Then connect this JS code activity to your query activity or an Enrichment. Add a new column and use the formula

= $(instance/vars/@customoData)

1552232_pastedImage_2.png

When trying to filter thiis data you the condition as

'ABC_' + Month(GetDate()) + "/" + Day(GetDate()) + "/" + Year(GetDate())

1552233_pastedImage_3.png

Regards,
Vipul

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now