cancel
Showing results for 
Search instead for 
Did you mean: 

How to clear the Date of Birth

vervinckt_joyca
Active Contributor
0 Kudos

Hi,

I am wondering how I can make the "Date Of Birth" field empty in SAP Marketing Cloud.

The DOB can be set via

https://{{url}}-api.s4hana.ondemand.com/sap/opu/odata/sap/API_MKT_CONTACT_SRV;v=0004/$batch

with payload (leaving out some of the batch/changeset and irrelevant payload parts to make it readable)


[...]
PATCH ContactOriginData(ContactID='{{ID}}',ContactOrigin='{{ORIGIN}}') HTTP/1.1
[...]

{
    "OriginDataLastChgUTCDateTime" : "{{Timestamp}}",
    "BirthDate":"1965-10-28T00:00:00"
 }

[...]

However, when we try to clear the DOB with this payload:

[...]
PATCH ContactOriginData(ContactID='{{ID}}',ContactOrigin='{{ORIGIN}}') HTTP/1.1
[...]

{
    "OriginDataLastChgUTCDateTime" : "{{Timestamp}}",
    "BirthDate":""
 }

[...]

there is an error:

{"error":{"code":"/IWCOR/CX_DS_EP_PROPERTY_ERROR/005056A509B11ED1BF822D2D0917DA04","message":{"lang":"en","value":"Property 'BirthDate' at offset '82' has invalid value ''"},

Accepted Solutions (1)

Accepted Solutions (1)

former_member226
Employee
Employee

Hi,

You can simply pass the "BirthDate" value as null. Something like this:

--batch
Content-Type: multipart/mixed; boundary=changeset_761e49b6-3146-4a57-8d10-15816fb9c75a

--changeset_761e49b6-3146-4a57-8d10-15816fb9c75a
content-type: application/http
content-transfer-encoding: binary

PATCH ContactOriginData(ContactID='anne.aachen@democloud.hybris.com',ContactOrigin='SAP_HYBRIS_CONSUMER') HTTP/1.1
Content-Length: 1035
Accept: application/json
Sap-Cuan-RequestTimestamp: '2021-09-28T12:13:14'
Sap-Cuan-SourceSystemType: EXT
Sap-Cuan-SourceSystemId: HYBRIS
Sap-Cuan-SequenceId: UpdatePatch
Content-Type: application/json

{
"OriginDataLastChgUTCDateTime":"2019-06-04T21:40:09",
"BirthDate":null
}

--changeset_761e49b6-3146-4a57-8d10-15816fb9c75a--
--batch--

It will clear off the value.

BR
Saurabh

vervinckt_joyca
Active Contributor

Thanks Saurabh, that worked 🙂

Answers (0)