Zoho Deluge: Push Multi-Select Picklist containing Commas from CRM to Creator

What?
A very quick article on how to push a multi-select picklist from CRM to Creator.

Why?
We're trying to create a record in Creator off a button on the CRM Potential/Deal record. The CRM module has a multi-select picklist which will use commas to delimit but one of the options has a comma in its value.
// What I have in CRM:
{"My_MultiPicklist":["Option1","Options 2, 3"]}

// What Creator understands: FAILS
{"My_MultiPicklist":["["Option1","Options 2, 3"]"]}
With workaround .toString()
// What Creator understands: FAILS
{"My_MultiPicklist":["Option1","Options 2"," 3"]}

How?
So the way to push this value over to Creator is by converting the list to a string... notably comma delimited:
// Reading CRM:
l_MyMultiPicklist = List:String();
l_MyMultiPicklist.add("Option1");
l_MyMultiPicklist.add("Options 2, 3");

// Push to Creator:
m_CrmFields = Map();
m_CrmFields.put("My_MultiPicklist": l_MyMultiPicklist.toString(","));

// Yields ERROR: Failure, Invalid column value \"Options 2, 3\" specified
// i.e. Cannot match picklist option in Creator (Options 2 is split from 3)

Solution: In the Creator picklist/dropdown options, change any comma to , then in your CRM code to create the record in Creator:
l_MyMultiPicklist = List();
for each r_PicklistOption in r_DealDetails.get("My_MultiPicklist")
{
	v_PicklistOption = r_PicklistOption.trim().replaceAll(",", ",",true);
	l_MyMultiPicklist.add(v_PicklistOption);
}
m_CrmFields.put("My_MultiPicklist",l_ProductCategories.toString());

// Yields: SUCCESS: Note the "," will display as a comma in both Creator and CRM.

Related Articles

Joes Revolver Map

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin - Valid till 8 May 2022 3QnhmaBX7LQSRsC9hh6Je9rGQKEGNQNfPb
© 2021 Joel Lipman .com. All Rights Reserved.