How many "d"s can you find in:
Q: Concatenate a Collection of Strings (Text) into a comma-delimited string in a Flow I'm working with a product called SDocs which generates PDFs (among other things). I need to pass a comma-delimited String of "names" to generate more than one PDF at once.
The names (datatype: text) are already stored in a collection. Assuming I don't know the size of the Collection, is there a way to do this in a Flow without using Apex? I have no problem using Apex, the customer just prefers "No Code".


A: I am sure that there is more than one way to skin a cat, but here is something quick and dirty I came up with....

Prep


*

*[A] DocNamesCollection: Text Collection Variable

*[B] DocNamesList: Text Variable that is NOT a Collection

*[C] DocNamesCount: Number Variable


Flow

Step 1
This is just assigning "DocName01", "DocName02" and "DocName03" to DocNamesCollection for me to use in the sample Flow.
Step 2
A standard Loop through DocNamesCollection
Step 3
Add 1 to DocNamesCount
Step 4
Simple Decision element to check if DocNamesCount is greater than 1
First time through it will go straight to Step 5; after that, it should go through Step 6
Step 5
Add the current Loop item value to DocNamesList:

Step 6
Add a comma to DocNamesList:


Results
From the Flow debug:


After you exit the loop, you should be able to replace what you have highlighted in your question with the name of the Text List Variable (DocNamesList in the sample).
As stated earlier, there are multiple ways you could do it. If your original Collection of doc names is a Record Collection, you can grab the count directly. If you "manually" build your Collection of doc names earlier in the Flow, you could instead use the above loop, skip building a Collection, and instead directly add on to a non-Collection variable as shown.

user
The text includes 61 "d"s in total.
assistant