# Looking to populate multi-checklist with enumeration from workflow

**URL:** <https://community.hubspot.com/t/looking-to-populate-multi-checklist-with-enumeration-from-workflow/86250>\
**Category:** CMS Development\
**Tags:** enterprise\
**Created:** [July 27, 2023, 10:33am UTC](https://community.hubspot.com/t/looking-to-populate-multi-checklist-with-enumeration-from-workflow/86250 "2023-07-27T10:33:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CAntoniades](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@CAntoniades](https://community.hubspot.com/u/CAntoniades)\
**Post date:** [July 27, 2023, 10:33am UTC](https://community.hubspot.com/t/looking-to-populate-multi-checklist-with-enumeration-from-workflow/86250/1 "2023-07-27T10:33:30Z")

</div>

So we currently store multiple choice values in our internal database in a string with comma separated values. What I’m currently doing is, I’m splitting those values with a custom code block in a workflow:

```lia-code-sample
exports.main = async (event, callback) => {
 / *****
 Use inputs to get data from any action in your workflow and use it in your code instead of having to use the HubSpot API.
 ***** /
 const signupReason = event.inputFields['signup_reason_internal_array'];

 const signupReasonResult = signupReason.split(",");
 / *****
 Use the callback function to output data that can be used in later actions in your workflow.
 ***** /
 callback({
 outputFields: {
 signupReasonArray: signupReasonResult,
 }
 });
}

```

The output is an enumeration of the values available in the multi-checklist:

 ![CAntoniades_0-1690453899399.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/9/8/980ab0a90bca7c16c3ccdfa4e78447f11cd05b40.png)

What I’ve done as a next step is I’ve tried to use the copy property value action, but it’s giving me a very generic error:

 ![CAntoniades_1-1690453957465.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/9/9a94a19dc694772d4b50b35d8df14561d2e92896.png)

How can I solve this or at least get a more verbose log of the issue?

---

<div class="post-metadata">

**Author:** ![coldrickjack](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/coldrickjack/32/6684_2.png) [@coldrickjack](https://community.hubspot.com/u/coldrickjack)\
**Post date:** [July 27, 2023, 1:26pm UTC](https://community.hubspot.com/t/looking-to-populate-multi-checklist-with-enumeration-from-workflow/86250/2 "2023-07-27T13:26:18Z")

</div>

Hey @CAntoniades,

I think I know what the issue is. I’ve recorded a video running through the proposed fix: [Workflow Issue](https://share.vidyard.com/watch/s5oz6HN9xDRsZGkzawoBqU?). (The first half is me _trying_ to explain the issue you are seeing, the second half is me going through the actual fix! 😊 )

What I have opted to do is use the HubSpot Client to update the contact within the coded action instead of using the copy to property action. I believe there are some limitations to using the action when it comes to dealing with multiple enumeration values. The code I used (and reference in the video is below):

```lia-code-sample
const hubspot = require('@hubspot/api-client')
const hubspotClient = new hubspot.Client({
 accessToken: process.env.HUBSPOTTOKEN
})

exports.main = async (event) => {

 const signupReason = event.inputFields['signup_reason_internal_array'];
 const signupReasonResult = signupReason.split(",").toString().replaceAll(",", ";");
 console.log(signupReasonResult)

 const properties = {
 "sign_up_reason": signupReasonResult,
 };
 const SimplePublicObjectInput = {
 properties
 };
 const contactId = event.object.objectId;
 hubspotClient.crm.contacts.basicApi.update(contactId, SimplePublicObjectInput).then(response => {
 console.log(response);
 })
}

```

I should also add that going down this route requires setting up a private app within your portal. This is so we’ve got an access token to authenticate requests to HubSpot. It also means that there are daily limits in place but HubSpot is quite generous in terms of their limits. Full overview [here](https://developers.hubspot.com/docs/api/usage-details).

I hope that this is helpful in some way and points you towards a solution.

---

<div class="post-metadata">

**Author:** ![CAntoniades](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@CAntoniades](https://community.hubspot.com/u/CAntoniades)\
**Post date:** [September 1, 2023, 9:00am UTC](https://community.hubspot.com/t/looking-to-populate-multi-checklist-with-enumeration-from-workflow/86250/3 "2023-09-01T09:00:54Z")

</div>

I just got back to this.. Thank you so much for the detailed response @coldrickjack , I managed to get it to work.
