Skip to content

Bug/2444 bug update data extension field name creates a new field instead of updating the existing one#2459

Closed
yuliialikhyt wants to merge 6 commits intodevelopfrom
bug/2444-bug-update-data-extension-field-name-creates-a-new-field-instead-of-updating-the-existing-one
Closed

Bug/2444 bug update data extension field name creates a new field instead of updating the existing one#2459
yuliialikhyt wants to merge 6 commits intodevelopfrom
bug/2444-bug-update-data-extension-field-name-creates-a-new-field-instead-of-updating-the-existing-one

Conversation

@yuliialikhyt
Copy link
Copy Markdown
Collaborator

@yuliialikhyt yuliialikhyt commented Feb 6, 2026

PR details

What changes did you make? (Give an overview)

Updating the field name does not work via mcdev. It is possible to do via the UI. Whenever I tried to do that via mcdev, the field which I tried to update was not changed, but a new field was added.

Further details (optional)

...

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • test scripts updated
  • Wiki updated (if applicable)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 6, 2026

Coverage Report

Commit:56e3beb
Base: develop@b223b13

Type Base This PR
Total Statements Coverage  71.02%  71%  (-0.02%)
Total Branches Coverage  70.8%  70.89%  (+0.09%)
Total Functions Coverage  83.71%  83.71%  (+0%)
Total Lines Coverage  71.02%  71%  (-0.02%)
Details (changed files):
File Statements Branches Functions Lines
lib/metadataTypes/DataExtensionField.js  83.22%  71.18%  90.9%  83.22%

@yuliialikhyt yuliialikhyt self-assigned this Feb 9, 2026
…name-creates-a-new-field-instead-of-updating-the-existing-one
@yuliialikhyt yuliialikhyt marked this pull request as ready for review February 9, 2026 21:51
…-new-field-instead-of-updating-the-existing-one' of https://github.com/Accenture/sfmc-devtools into bug/2444-bug-update-data-extension-field-name-creates-a-new-field-instead-of-updating-the-existing-one
@yuliialikhyt
Copy link
Copy Markdown
Collaborator Author

Once the bug was fixed, the unit tests started failing, so I had to make some changes to the test data.

This file is "deployed", added some missing fields. Also, Name_new field was removed from the file to deploy, and instead the Name field was updated.

test/mockRoot/deploy/testInstance/testBU/dataExtension/testExisting_dataExtension.dataExtension-meta.json

And this is what it expects:
test\resources\9999999\dataExtension\update-expected.json

Also, here moved the field newField below:
https://github.com/Accenture/sfmc-devtools/blob/56e3beb8b172d08aaccde6fe0929d6149f16327c/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testExisting_dataExtensionShared.dataExtension-meta.json

Because ContactKey is the fourth field in the data extension, and the script considers this a field rename (Ordinal: 3)
test\resources\1111111\dataExtensionField\retrieve-DataExtension.CustomerKey=testExisting_dataExtensionShared-response.xml

@JoernBerkefeld
Copy link
Copy Markdown
Contributor

@yuliialikhyt
Copy link
Copy Markdown
Collaborator Author

uhm, question: did you try this guide? https://github.com/Accenture/sfmc-devtools/wiki/08.-Metadata-specific-settings-&-options#renaming-fields-of-a-data-extensions

I did not see that 😆 Name_new approach works as expected.
Updating the "Name" property seems easier, though. As long as there is a working solution, we can close the bug.

@JoernBerkefeld
Copy link
Copy Markdown
Contributor

yes that seems easier but frankly it's dependent on the position of the field in the array which could be different across environments - which is why i discarded a direct update option in favor of the Name_new approach.

this works flawlessly in the GUI because there they have the field object id for each field before the edit and hence can target their update on that particular field alone.

closing this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Update data extension field name creates a new field instead of updating the existing one

2 participants