Expand my Community achievements bar.

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

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

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