Need to set a multi-select field.

Need to set a multi-select field.

When a deal is created, I have it going to Zoho Flow. What I want to do is take a string/list that is not properly formatted and insert/default it into a multi-select field. I am having issues with this and would appreciate some help.

My incoming string: "item1, item2, item3"
The field I want to update/set is Optional_Coverage

I tried using a custom function in Zoho Flow thinking I can manipulate the ", " to a ";" and update the deal, but it's not working for me. Can you please help me with a custom function I can use to solve this issue. Here is the code I tried:

void optioncoverage1(int dealID, string optionalcoverage)
{
newcoverage = optionalcoverage.replaceAll(", ",";");
resp = zoho.crm.updateRecord("Potentials",dealID,{"Optional_Coverage":newcoverage});
}

It did not work. Any assistance would be much appreciated.