cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Data Replacement Functionality

valentinrabitz
Discoverer
0 Likes
917

Hello team,

How is it possible to set string or integer or number attributes to null?

I successfully activated data replacement https://help.sap.com/docs/customer-data-platform/apis/data-replacement?locale=en-US for the specific event.

However, it is unclear to me what needs to be sent in the payload in order to set the value to null/empty again. Sending null leads to an error.

Thanks! Best regards, Valentin

Accepted Solutions (1)

Accepted Solutions (1)

Oleh_Ilchyshyn1
Active Participant

Hello v.rabitz,

1) As I know the purpose of Data Replacement is not to make empty single fields. Assuming you have emails:

{
  "emails": [
    "test1.user@gmail.com",
"test2.user@gmail.com",
"test3.user@gmail.com" ] }

And you are going to ingest new entry:

{
  "emails": [
    "test4.user@gmail.com"
  ]
}

If Data Replacement is Activated, you will get emails replaced by the new value, like:

{
  "emails": [
    "test4.user@gmail.com"
  ]
}

If Data Replacement is Deactivated, you will get emails appended by the value, like:
{

  "emails": [
    "test1.user@gmail.com",
"test2.user@gmail.com",
"test3.user@gmail.com",
"test4.user@gmail.com" ] }


2. Yes, you are right, setting null explicitly in CDP causes to error.
But you can use empty strings "", and make the value empty in your payload, like for the department below:

{
  "events": [
    {
      "crmID": "0000000000",
      "primaryEmail": "test.user@gmail.com",
      "firstName": "Test",
      "lastName": "Users",
      "department": "",
      "companyName": "Test company"
    }
  ]
}

3. Please also take into account that for each Connector you can define a Data Quality Rank configuration.

Imagine you have 2 Connectors:
- Connector 1 with Good Data Quality Rank
- Connector 2 with Fair Data Quality Rank

If you ingested payload with {"department": 'IT'} in Connector 1, you cannot make it empty("") in Connector 2.
In other words, you can do it, but because of Data Quality Rank, you will not get an effect, as Connector 1 has higher Data Quality Rank configuration.

Hope the notes above helped you.

Answers (1)

Answers (1)

KunalBansal
SAP Champion
SAP Champion
0 Likes

Hello v.rabitz,

Please use the POST Body API call for NULL as -

{ "replaceType" : " " }

https://cdp.eu5.gigya.com/api/businessunits/{businessUnitId}/applications/{sourceId}/dataevents/{eventId}/replaceConfig?userKey={userKey]&secret{secret}

I hope this was helpful to close the thread.

best regards,

Kunal, SAP CX Architect

valentinrabitz
Discoverer
0 Likes

Hi bansal.kunal,

I've already set the replaceConfig as stated in the SAP documentation - this works fine.

My question is how to actually set an empty/null value for a specific attribute (e.g., integer attribute "age").

Best regards, Valentin