I have passed a string in exactly this format with a ',' delimiter (a014K000001W1wqQAC,000410001006672,500,34567) from a flow to an invocable APEX method.

    public class obuTopUpTrailhead {
    public static void invokeapexcallout(list<String> obuDetails){
      for (string s : obuDetails){
         // Loop body

In the APEX class invokable method, how can I split comma delimited String and assign them to public class variables? This is what I am looking to perform:
Var 1 = a014K000001W1wqQAC
Var 2 = 000410001006672
Var 3 = 500
Var 4 = 34567

Thanks in advance for every bit of help!


1 Answer 1


You pretty much already answered it; you just use the split method.

  for (string s : obuDetails){
    String[] parts = s.split(',');
    var1 = parts[0];
    var2 = parts[1];
  • Thanks a lot. Yes got it working :-)
    – d039043
    Jun 24, 2020 at 16:25

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.