Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/1406 creating events fails if dekey is set alongside schema #1417

Conversation

JoernBerkefeld
Copy link
Contributor

@JoernBerkefeld JoernBerkefeld commented Jul 5, 2024

PR details

What changes did you make? (Give an overview)

Further details (optional)

implemented a fallback routine:

  1. search for specified DE on server and pick that if found
  2. else, if schema is provided in event json, let eventDefinition API create a DE for us
  3. rename and rekey the auto-created DE

Checklist

@JoernBerkefeld JoernBerkefeld added c/dataExtension COMPONENT c/event COMPONENT labels Jul 5, 2024
@JoernBerkefeld JoernBerkefeld added this to the 7.0.4 milestone Jul 5, 2024
@JoernBerkefeld JoernBerkefeld self-assigned this Jul 5, 2024
@github-actions github-actions bot added the bug Something isn't working label Jul 5, 2024
@JoernBerkefeld JoernBerkefeld changed the base branch from develop to 1403-bump-sfmc-sdk-from-200-to-210 July 5, 2024 15:12
Base automatically changed from 1403-bump-sfmc-sdk-from-200-to-210 to develop July 5, 2024 15:25
Copy link

github-actions bot commented Jul 5, 2024

Coverage Report

Commit:d1a776f
Base: develop@b9e47eb

Type Base This PR
Total Statements Coverage  68.77%  69.25%  (+0.48%)
Total Branches Coverage  67.93%  67.83%  (-0.1%)
Total Functions Coverage  79.49%  80.85%  (+1.36%)
Total Lines Coverage  68.77%  69.25%  (+0.48%)
Details (changed files):
File Statements Branches Functions Lines

@JoernBerkefeld JoernBerkefeld mentioned this pull request Jul 8, 2024
11 tasks
@JoernBerkefeld JoernBerkefeld merged commit 2b9e32c into develop Jul 8, 2024
12 checks passed
@JoernBerkefeld JoernBerkefeld deleted the bug/1406-creating-events-fails-if-dekey-is-set-alongside-schema branch July 8, 2024 11:34
@JoernBerkefeld
Copy link
Contributor Author

JoernBerkefeld commented Jul 8, 2024

Documentation

https://github.com/Accenture/sfmc-devtools/wiki/08.-Metadata-specific-settings-%26-options/_edit

Event (event)

Update event definitions

Once created, you may only update the fields r__dataExtension_key, name, or eventDefinitionKey. Other fields are locked.

Create event definitions

When creating new events you can include a dataExtension in the deployment payload or pre-deploy it separately before you deploy the event, as long as you link it via r__dataExtension_key.
If you do not set r__dataExtension_key or you did set it but you provide a schema section then that is used to auto-generate a dataExtension for you.

Valid deployments for create:

  • schema and dataExtension key set
{
    "type": "APIEvent",
    "name": "testNew_event_withSchema",
    "description": "updated on deploy",
    "eventDefinitionKey": "testNew_event_withSchema",
    "schema": {
        "fields": [
            {
                "name": "ContactId",
                "dataType": "Text",
                "maxLength": 18,
                "isNullable": false,
                "isPrimaryKey": true
            },
            {
                "name": "Type",
                "dataType": "Text",
                "maxLength": "50",
                "isNullable": false,
                "isPrimaryKey": false
            }
        ],
        "sendableCustomObjectField": "ContactId",
        "sendableSubscriberField": "_SubscriberKey"
    },
    "isVisibleInPicker": true,
    "r__dataExtension_key": "testNew_event_withSchema"
}
  • only dataExtension key set
{
    "type": "APIEvent",
    "name": "testNew_event_withSchema",
    "description": "updated on deploy",
    "eventDefinitionKey": "testNew_event_withSchema",
    "isVisibleInPicker": true,
    "r__dataExtension_key": "testNew_event_withSchema"
}
  • only schema set
{
    "type": "APIEvent",
    "name": "testNew_event_withSchema",
    "description": "updated on deploy",
    "eventDefinitionKey": "testNew_event_withSchema",
    "schema": {
        "fields": [
            {
                "name": "ContactId",
                "dataType": "Text",
                "maxLength": 18,
                "isNullable": false,
                "isPrimaryKey": true
            },
            {
                "name": "Type",
                "dataType": "Text",
                "maxLength": "50",
                "isNullable": false,
                "isPrimaryKey": false
            }
        ],
        "sendableCustomObjectField": "ContactId",
        "sendableSubscriberField": "_SubscriberKey"
    },
    "isVisibleInPicker": true,
}

Invalid deployments for create:

  • no schema and no dataExtension set
{
    "type": "APIEvent",
    "name": "testNew_event_withSchema",
    "description": "updated on deploy",
    "mode": "Production",
    "eventDefinitionKey": "testNew_event_withSchema",
    "isVisibleInPicker": true,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c/dataExtension COMPONENT c/event COMPONENT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] creating events fails if deKey is set alongside schema
1 participant