Discussions

Enable setting "CDO Default Entity Field Mapping" via Application API

User_31X4J
User_31X4J Posts: 8 Blue Ribbon
edited Aug 10, 2020 1:58PM in Dream It

On CDO Create and/or Update via Application API, enable setting of "CDO Default Entity Field Mapping". including Entity Type and Entity Field.  Without this functionality, data card uploads via the import wizard do not always automatically map to corresponding records.

Post edited by Unknown User on
1 votes

Active · Last Updated

Comments

  • Lou Patrick
    Lou Patrick Principal Product Manager, Eloqua APIs & App Developer Framework Portland, ORPosts: 174 Bronze Trophy

    The ability to map Custom Object records is currently available using the Application API and the Bulk API.

    Application API (Contacts only, by Contact Id only):

         Endpoint: Create custom object data

         Example request creating a new Custom Object record for a Custom Object with an id of 14, and mapping the record to a Contact record with the id of 1:

              Request

    POST  /api/REST/2.0/data/customObject/14/instance

              Request - Body

    {  "type": "CustomObjectData",  "contactId": "1",  "fieldValues": [    {      "id": "107",      "value": "[email protected]"    }  ]}

              Response

    {  "type": "CustomObjectData",  "id": "31",  "contactId": "1",  "fieldValues": [    {      "id": "107",      "value": "[email protected]"    }  ]}

              Note, I confirmed Custom Object record was successfully mapped to Contact in Eloqua.

    Bulk API (Contacts and Accounts):

         Endpoints and Tutorial:

         Example import definition request to import Custom Object records for a Custom Object with an id of 14, and map them to Account records using the Company Name Account field:

              Request

    POST /api/bulk/2.0/customObjects/14/imports

              Request - Body

    {  "name": "Map to Accounts Import",  "fields": {    "email": "{{CustomObject[14].Field[107]}}",    "companyName": "{{CustomObject[14].Field[108]}}"   },  "identifierFieldName": "email",  "mapDataCards": true,  "mapDataCardsEntityType": "Company",  "mapDataCardsEntityField": "{{Account.Field(M_CompanyName)}}",  "mapDataCardsSourceField": "companyName",  "mapDataCardsCaseSensitiveMatch": false}

              Response

    {  "id": 20,  "parentId": 14,  "mapDataCards": true,  "mapDataCardsCaseSensitiveMatch": false,  "mapDataCardsEntityField": "{{Account.Field(M_CompanyName)}}",  "mapDataCardsSourceField": "companyName",  "mapDataCardsEntityType": "Company",  "name": "Map to Accounts Import",  "fields": {    "email": "{{CustomObject[14].Field[107]}}",    "companyName": "{{CustomObject[14].Field[108]}}"  },  "identifierFieldName": "email",  "isSyncTriggeredOnImport": false,  "dataRetentionDuration": "P7D",  "isUpdatingMultipleMatchedRecords": false,  "uri": "/customObjects/14/imports/20",  "createdBy": "Lou.Patrick",  "createdAt": "2016-07-29T22:13:27.9841117Z",  "updatedBy": "Lou.Patrick",  "updatedAt": "2016-07-29T22:13:27.9841117Z"}
  • User_31X4J
    User_31X4J Posts: 8 Blue Ribbon

    Thanks for the response, Lou!

    Sorry, I wasn't specific enough - Using API script, we'd like to be able to set Email Address as the Default Entity Mapping field for CDOs upon CDO creation and/or update via API.  Using API script, we're scheduling SQL data to automatically create CDOs and regularly upload current data to them but there doesn't appear to be a way, using API script, to pre-set Email Address as the Default Entity Mapping field for each CDO in order to map CDO data cards to contact records on email address.

    Appreciate any additional input!

    map using EmailAddress on the contact object

  • Lou Patrick
    Lou Patrick Principal Product Manager, Eloqua APIs & App Developer Framework Portland, ORPosts: 174 Bronze Trophy

    Thanks for the response, Lou!

    Sorry, I wasn't specific enough - Using API script, we'd like to be able to set Email Address as the Default Entity Mapping field for CDOs upon CDO creation and/or update via API.  Using API script, we're scheduling SQL data to automatically create CDOs and regularly upload current data to them but there doesn't appear to be a way, using API script, to pre-set Email Address as the Default Entity Mapping field for each CDO in order to map CDO data cards to contact records on email address.

    Appreciate any additional input!

    map using EmailAddress on the contact object

    Using the Bulk API this can be accomplished using the mapDataCards parameters as detailed in previous comment.

  • User_31X4J
    User_31X4J Posts: 8 Blue Ribbon

    Lou, will the solution you provided above still work for SQL contacts that don't initially have an Eloqua ContactID (i.e., new contacts being loaded to Eloqua)?  Thanks again!

  • Lou Patrick
    Lou Patrick Principal Product Manager, Eloqua APIs & App Developer Framework Portland, ORPosts: 174 Bronze Trophy

    Lou, will the solution you provided above still work for SQL contacts that don't initially have an Eloqua ContactID (i.e., new contacts being loaded to Eloqua)?  Thanks again!

    Yes, the Bulk API allows you to choose the field to match on when importing, i.e. you can match on email address. See Import data into Eloqua for a tutorial on importing data via the Bulk API.

  • User_31X4J
    User_31X4J Posts: 8 Blue Ribbon

    Thanks much!  We'll look into this.  Appreciate your insight!

  • User_31X4J
    User_31X4J Posts: 8 Blue Ribbon

    We tested three different Bulk API scripts (below) with the same request structure you provided but with different values for the following variables and got this note upon execution:  "Request 3 will not add records into contact object"

    1) Identifier field as "EloquaKey"

    2) mapCardsEntityType as "Contact" instead of "Company"

    3) mapcardsourcefield as "EmailAdress"

    What did we miss?  Thanks!

    Bulk API Scripts:

    Script #1

    {

    "identifierFieldName": "EloquaKey",

    "name": "cdo_import_definition_TestCDO_For_ContactMap_WithoutBuild_1_20200521_637256176675882899",

    "fields": {

    "EloquaKey": "{{CustomObject[1183].Field[68904]}}",

    "EmailAddress": "{{CustomObject[1183].Field[68905]}}",

    "EntityType1": "{{CustomObject[1183].Field[68906]}}",

    "FirstName1": "{{CustomObject[1183].Field[68907]}}",

    "LastName11": "{{CustomObject[1183].Field[68908]}}",

    "LastName21": "{{CustomObject[1183].Field[68909]}}"

        },

    "isSyncTriggeredOnImport": false,

    "updateRule": "always",

    "mapDataCardsEntityType": "Contact",

    "mapDataCardsSourceField": "EmailAddress",

    "mapDataCardsEntityField": "{{Contact.Field(C_EmailAddress)}}",

    "dataRetentionDuration": "P2D",

    "mapDataCards": "true",

    "autoDeleteDuration": "P2D",

    "isUpdatingMultipleMatchedRecords": true

    }

    Script #2

    {

    "identifierFieldName": "EloquaKey",

    "name": "cdo_import_definition_TestCDO_For_ContactMap_WithoutBuild_1_20200521_637256429148674591",

    "fields": {

    "EloquaKey": "{{CustomObject[1183].Field[68904]}}",

    "EmailAddress": "{{CustomObject[1183].Field[68905]}}",

    "EntityType1": "{{CustomObject[1183].Field[68906]}}",

    "FirstName1": "{{CustomObject[1183].Field[68907]}}",

    "LastName11": "{{CustomObject[1183].Field[68908]}}",

    "LastName21": "{{CustomObject[1183].Field[68909]}}"

        },

    "isSyncTriggeredOnImport": false,

    "updateRule": "always",

    "mapDataCardsEntityType": "1",

    "mapDataCardsSourceField": "EmailAddress",

    "mapDataCardsEntityField": "{{Contact.Field(C_EmailAddress)}}",

    "dataRetentionDuration": "P2D",

    "mapDataCards": true,

    "autoDeleteDuration": "P2D",

    "isUpdatingMultipleMatchedRecords": true

    }

    Script #3

    {

    "identifierFieldName": "EloquaKey",

    "name": "cdo_import_definition_TestCDO_For_ContactMap_WithoutBuild_1_20200521_637256440496358808",

    "fields": {

    "EloquaKey": "{{CustomObject[1183].Field[68904]}}",

    "EmailAddress": "{{CustomObject[1183].Field[68905]}}",

    "EntityType1": "{{CustomObject[1183].Field[68906]}}",

    "FirstName1": "{{CustomObject[1183].Field[68907]}}",

    "LastName11": "{{CustomObject[1183].Field[68908]}}",

    "LastName21": "{{CustomObject[1183].Field[68909]}}"

        },

    "isSyncTriggeredOnImport": false,

    "updateRule": "always",

    "mapDataCardsEntityType": "Contact",

    "mapDataCardsSourceField": "EmailAddress",

    "mapDataCardsEntityField": "{{Contact.Field(ContactIDExt)}}",

    "dataRetentionDuration": "P2D",

    "mapDataCards": true,

    "autoDeleteDuration": "P2D",

    "isUpdatingMultipleMatchedRecords": true

    }

  • Lou Patrick
    Lou Patrick Principal Product Manager, Eloqua APIs & App Developer Framework Portland, ORPosts: 174 Bronze Trophy

    We tested three different Bulk API scripts (below) with the same request structure you provided but with different values for the following variables and got this note upon execution:  "Request 3 will not add records into contact object"

    1) Identifier field as "EloquaKey"

    2) mapCardsEntityType as "Contact" instead of "Company"

    3) mapcardsourcefield as "EmailAdress"

    What did we miss?  Thanks!

    Bulk API Scripts:

    Script #1

    {

    "identifierFieldName": "EloquaKey",

    "name": "cdo_import_definition_TestCDO_For_ContactMap_WithoutBuild_1_20200521_637256176675882899",

    "fields": {

    "EloquaKey": "{{CustomObject[1183].Field[68904]}}",

    "EmailAddress": "{{CustomObject[1183].Field[68905]}}",

    "EntityType1": "{{CustomObject[1183].Field[68906]}}",

    "FirstName1": "{{CustomObject[1183].Field[68907]}}",

    "LastName11": "{{CustomObject[1183].Field[68908]}}",

    "LastName21": "{{CustomObject[1183].Field[68909]}}"

        },

    "isSyncTriggeredOnImport": false,

    "updateRule": "always",

    "mapDataCardsEntityType": "Contact",

    "mapDataCardsSourceField": "EmailAddress",

    "mapDataCardsEntityField": "{{Contact.Field(C_EmailAddress)}}",

    "dataRetentionDuration": "P2D",

    "mapDataCards": "true",

    "autoDeleteDuration": "P2D",

    "isUpdatingMultipleMatchedRecords": true

    }

    Script #2

    {

    "identifierFieldName": "EloquaKey",

    "name": "cdo_import_definition_TestCDO_For_ContactMap_WithoutBuild_1_20200521_637256429148674591",

    "fields": {

    "EloquaKey": "{{CustomObject[1183].Field[68904]}}",

    "EmailAddress": "{{CustomObject[1183].Field[68905]}}",

    "EntityType1": "{{CustomObject[1183].Field[68906]}}",

    "FirstName1": "{{CustomObject[1183].Field[68907]}}",

    "LastName11": "{{CustomObject[1183].Field[68908]}}",

    "LastName21": "{{CustomObject[1183].Field[68909]}}"

        },

    "isSyncTriggeredOnImport": false,

    "updateRule": "always",

    "mapDataCardsEntityType": "1",

    "mapDataCardsSourceField": "EmailAddress",

    "mapDataCardsEntityField": "{{Contact.Field(C_EmailAddress)}}",

    "dataRetentionDuration": "P2D",

    "mapDataCards": true,

    "autoDeleteDuration": "P2D",

    "isUpdatingMultipleMatchedRecords": true

    }

    Script #3

    {

    "identifierFieldName": "EloquaKey",

    "name": "cdo_import_definition_TestCDO_For_ContactMap_WithoutBuild_1_20200521_637256440496358808",

    "fields": {

    "EloquaKey": "{{CustomObject[1183].Field[68904]}}",

    "EmailAddress": "{{CustomObject[1183].Field[68905]}}",

    "EntityType1": "{{CustomObject[1183].Field[68906]}}",

    "FirstName1": "{{CustomObject[1183].Field[68907]}}",

    "LastName11": "{{CustomObject[1183].Field[68908]}}",

    "LastName21": "{{CustomObject[1183].Field[68909]}}"

        },

    "isSyncTriggeredOnImport": false,

    "updateRule": "always",

    "mapDataCardsEntityType": "Contact",

    "mapDataCardsSourceField": "EmailAddress",

    "mapDataCardsEntityField": "{{Contact.Field(ContactIDExt)}}",

    "dataRetentionDuration": "P2D",

    "mapDataCards": true,

    "autoDeleteDuration": "P2D",

    "isUpdatingMultipleMatchedRecords": true

    }

    For script 3, assuming the custom object field set to "EmailAddress" is actually storing an email address, you'd need to set mapDataCardsEntityField to the contact email address field "{{Contact.Field(C_EmailAddress)}}" in order to successfully map.

  • User_31X4J
    User_31X4J Posts: 8 Blue Ribbon
    edited Aug 10, 2020 11:22AM

    Lou, if we make the last change you suggested, then it's the same as script 1, which is working but the issue is that it doesn't actually update the Default Entity Field Mapping in the CDO UI:

    pastedImage_0.png

  • Lou Patrick
    Lou Patrick Principal Product Manager, Eloqua APIs & App Developer Framework Portland, ORPosts: 174 Bronze Trophy

    Lou, if we make the last change you suggested, then it's the same as script 1, which is working but the issue is that it doesn't actually update the Default Entity Field Mapping in the CDO UI:

    pastedImage_0.png

    The Default Entity Field Mapping in the CDO UI only applies to uploads, and has no impact on the Bulk API. It only sets the default on step 4 of the Custom Object Record Upload Wizard, for which you can change it once you arrive on the step.

  • User_31X4J
    User_31X4J Posts: 8 Blue Ribbon
    edited Aug 10, 2020 1:51PM

    Yeah, so what we're trying to solve for is the automated setting of that Entity Field (=Email Address) for the Default Entity Mapping of the CDO UI (image in my last comment) using API - it sounds like that's not possible?  If not, then this would be a great feature to have for more full/completion functionality around CDO creation/upload via API.

    Post edited by Unknown User on
  • Lou Patrick
    Lou Patrick Principal Product Manager, Eloqua APIs & App Developer Framework Portland, ORPosts: 174 Bronze Trophy

    Yeah, so what we're trying to solve for is the automated setting of that Entity Field (=Email Address) for the Default Entity Mapping of the CDO UI (image in my last comment) using API - it sounds like that's not possible?  If not, then this would be a great feature to have for more full/completion functionality around CDO creation/upload via API.

    That is not possible today. I've updated this idea to reflect this feature request and re-opened.

  • User_31X4J
    User_31X4J Posts: 8 Blue Ribbon

    Okay.  Thanks much for your time and attention to this inquiry, Lou!  Greatly appreciated!