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


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 '18 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.