back to top

Creating a Comma-Delimited List of Values from a Read Data Element in a Creatio Process

This article will look at how to use the results of a Read Data element in a Creatio process to create a comma-delimited list of the values in a single string. For this article, I’ll be reading contact records, then creating a comma-delimited list of their email addresses (with the idea that I can then use that to send an email to the contacts).

A read data element has a few different modes, one of them being to Read a Collection of Records. This is the mode we’ll need for this (the default mode only reads the first record that matches the conditions, we want all of them which is what the “read a collection of records” will provide). The collection of records is just like any collection of records in a process, see the previous article about using collections in processes:

Working With Collection Parameters in a Process Script Task in Creatio

A couple of setup items, we’ll need a text process parameter where we will put the comma-list of email addresses, in my sample I’ve named that EmailList. For the Read Data element, be sure it’s set to Read a collection of records (and obviously make sure it contains the column you’ll want, in my case the Email column)

The key to be able to get the actual collection from this read data element is to know what it’s name (Code) is. To get this, we’ll need to switch to Advanced mode of the Read data element

Then you can see the Code of the element:

Now, in the script task, we can access the results (the collection of records) from this Read Data element by using (note the Code/name of the read data element, in my case that name is “ReadDataUserTask1”):

var items = Get<ICompositeObjectList<ICompositeObject>>("ReadDataUserTask1.ResultCompositeObjectList");

From there, it’s just like working with any collection parameter. For my sample, I want to create a comma-delimited list of the email addresses for the contacts in the results. That code would look like the following:

var items = Get<ICompositeObjectList<ICompositeObject>>("ReadDataUserTask1.ResultCompositeObjectList");
var list = "";

// now loop through the objects returned by the read data element
foreach (ICompositeObject item in items)
{
	if (item.TryGetValue<string>("Email", out string value))
	{
		if (list.Length > 0) list += ", ";
		list += value;
	}
}

Set("EmailList", list);

return true;

The end result would be a string of email addresses, such as “person1@email1.com, person2@email2.com, person3@email3.com” that would be placed in the text param in my process.

Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author
Ryan Farley
Ryan Farleyhttps://customerfx.com/article/author/ryanfarley/
Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix, now Infor CRM, since 2001 and believes in sharing with the community. His new passion for CRM is Creatio, formerly bpm'online. He loves C#, Javascript, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

2 COMMENTS

  1. Is there any way to iterate over all keys in an ICompositeObject? I don’t believe there is, but would love to be wrong! I believe there would be if the object were actually a CompositeObject instead of an ICompositeObject, but unfortunately both Read Data steps and using the Transform extension method against an EntityCollection return by ESQ return an ICompositeObject. Are you aware of any way to get all the keys from one though?

LEAVE A REPLY

Please enter your comment!
Please enter your name here

AI Readiness Checklist for CRM Teams: Is Your CRM System Ready for AI?

Before using AI in Creatio, make sure your CRM data, users, processes, and automation foundation are ready. Use this practical AI readiness checklist for CRM teams.

Build Your Creatio AI Skills with the 2026 AI Summer Program

Join Creatio’s free 2026 AI Summer Program to learn how to identify, build, deploy, and manage AI agents.

Creatio 10x Is Coming: Join the Webinar to Explore the Future of AI-Native CRM

Learn what's new in Creatio 10x and how AI-native CRM, agentic AI, and no-code automation are shaping the future of customer relationship management. Join the upcoming webinar and discover what's next.

Creatio Unlimited Pricing Explained: AI Packages, Costs, Pros & Cons

Learn what Creatio’s new Unlimited pricing model includes, what it doesn’t include, how AI Action packages work, and the pros and cons for businesses evaluating Creatio.

Using the AI Prompt to Create Dynamic Folders in Creatio

Using Creatio's AI prompt to create the filter for a dynamic folder works best if you specifically ask for that, and if you are as clear and direct as possible about the filtering, conditions.

Related Articles

AI Readiness Checklist for CRM Teams: Is Your CRM System Ready for AI?

Before using AI in Creatio, make sure your CRM data, users, processes, and automation foundation are ready. Use this practical AI readiness checklist for CRM teams.

Build Your Creatio AI Skills with the 2026 AI Summer Program

Join Creatio’s free 2026 AI Summer Program to learn how to identify, build, deploy, and manage AI agents.

Creatio 10x Is Coming: Join the Webinar to Explore the Future of AI-Native CRM

Learn what's new in Creatio 10x and how AI-native CRM, agentic AI, and no-code automation are shaping the future of customer relationship management. Join the upcoming webinar and discover what's next.

Creatio Unlimited Pricing Explained: AI Packages, Costs, Pros & Cons

Learn what Creatio’s new Unlimited pricing model includes, what it doesn’t include, how AI Action packages work, and the pros and cons for businesses evaluating Creatio.

Related Videos