Anyone know how to copy one date field from another?

Ronda_Vye
Level 2

Anyone know how to copy one date field from another?

I have a date field that I need to populate into another date field but the when I create Data Value Change, it won't seem to update the field.

I have also tried adding {{system.time}} after the token but nothing seems to allow me to copy the field from one to another.

Any help would be appreciated.

pastedImage_0.png

6 REPLIES 6
Devraj_Grewal
Level 10 - Champion Alumni

Re: Anyone know how to copy one date field from another?

Ronda,

"Email Opted In Date/Time (C)" seems like a datetime field whereas "gdpr_optin_date" may only be a date field. If so, this change data value may not work. Check both fields in Admin > Field Management and confirm they are the same field type.

If possible, you can change the field type.

Anne_Angele1
Level 4

Re: Anyone know how to copy one date field from another?

Like Devraj said, it looks like you're copying the wrong data type into the field, so it won't accept it.

Jason_Keller3
Level 2

Re: Anyone know how to copy one date field from another?

Given that the date formats are different, what is limiting you from timestamping the second value with a {{system.date}} token with a data-value change trigger?

Anne_Angele1
Level 4

Re: Anyone know how to copy one date field from another?

The date/time field requires the format to be HH:MM:SS for the time portion, the system time field is formatted as HH:MM XM (Time Zone).

ETA: The system token for date/time DOES use the correct HH:MM:SS format to be put into the date/time field type, for the record.

Jason_Keller3
Level 2

Re: Anyone know how to copy one date field from another?

I think you may have misread my question - I was offering an alternative trigger to populate the second value instead of attempting to make the value populated by referencing the original value.

It seems like she can trigger the second value to be timestamped when the first value was and then control that value with additional triggers/filters as needed.

Jay_Jiang
Level 10

Re: Anyone know how to copy one date field from another?

Because the OP might be trying to fill out values in retrospect by running a batch campaign and so the current time is not correct.

Webhook solution to truncate the time part in a datetime field so you can save the date to a date only field:

<?php

if(isset($_POST['datetime'])){

$d = explode(" ", $_POST['datetime']);

echo json_encode(array("response"=>$d[0]));

}

?>