How would I create an array of the values from the flow and pass them into the APEX @InvocableMethod?

My method is taking in a list of Strings:

public static List<String> AutoStartFlowToWebservice(List<String> values) {...}

And my flow has 4 values to be passed but they need to be combined into one list in order to pass them to the Apex class. Right now they are all separated. Creating a collection variable doesn't seem right to me because there is no where to add the values to it. Is there another step that I need to do within the flow to add the values to the collection variable?

enter image description here

enter image description here

1 Answer 1


Probably, this could be easy solution.

I would suggest to gather a String value in a comma delimited way from the flow and then pass it to the Invocable method.

The resultant String will look like this:

{!varCRCId} & ',' & {!varCRId}  & ',' & {!varManualStart}  & ',' & {!varProcessStep} 

So change the signature from List<String> to String

public static List<String> AutoStartFlowToWebservice(String values) {...}

And, you know how to split comma delimited String and create a List<String> in the invocable method (if needed).

  • 1
    that could work, good idea!
    – Olivia
    Feb 6, 2018 at 20:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .