# Error when using custom code workflow action to merge contacts based on matching phone number

**URL:** <https://community.hubspot.com/t/error-when-using-custom-code-workflow-action-to-merge-contacts-based-on-matching-phone-number/88939>\
**Category:** CMS Development\
**Tags:** javascript\
**Created:** [September 5, 2023, 1:58am UTC](https://community.hubspot.com/t/error-when-using-custom-code-workflow-action-to-merge-contacts-based-on-matching-phone-number/88939 "2023-09-05T01:58:21Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![MatthewShepherd](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/matthewshepherd/32/31314_2.png) [@MatthewShepherd](https://community.hubspot.com/u/MatthewShepherd)\
**Post date:** [September 27, 2023, 9:19am UTC](https://community.hubspot.com/t/error-when-using-custom-code-workflow-action-to-merge-contacts-based-on-matching-phone-number/88939/4 "2023-09-27T09:19:33Z")

</div>

Hi @tcxen  
I recently used this code and had to remove the body node from contactResult.body.properties and searchResults.body.results [as mentioned in this issue](https://github.com/HubSpot/sample-workflow-custom-code/issues/29). So they become contactResult.properties and searchResults.results.  
Hope that helps.

---

_[View the full topic](https://community.hubspot.com/t/error-when-using-custom-code-workflow-action-to-merge-contacts-based-on-matching-phone-number/88939)._
