function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
indyindy 

String concatenation/manipulation value from Flow 1 is not reflecting in Flow 2

A string value is being concatenated in Apex class and the value is passed from Flow 1 to Flow 2.(Flow 2 is sub flow).
The individually declared string variables are concatenated without any issues but the concatenated List values are displayed only in Flow 1 but not in Flow 2.
i.e. As per the below code, when Flow 1 invokes apex action(AddString.mainMethod), The final concatenated string 'finalString' is showing the results in Flow 1, but when we pass the same 'finalString' value to Flow 2, only the first concatenation method results i.e. stringSet1() are showing and not the data from the method stringSet2.

 
public class wrapper{

     @AuraEnabled @InvocableVariable
     public string str1;

     @AuraEnabled @InvocableVariable
     public string str2;

     @AuraEnabled @InvocableVariable
     public string str3;

     @AuraEnabled @InvocableVariable
     public List<String> stringArray;
    }
    
    public class AddString{
     
     @InvocableMethod
     public static List<String> mainMethod(List<Wrapper> wrap){
       String finalString = stringSet1(wrap.get(0))+stringSet2(wrap.get(0).inputSet));
       return new List<String>{finalString};
     }
     private static string stringSet1(wrapper wr){
        return wr.str1+'\n'+wr.str2+'\n'+wr.str3+'\n';
     }
     
     private static string stringSet2(List<String> strSet){
         String tempStr;
         for(String str: strSet){
            tempStr+= strSet+'\n';
         }
         return strSet;
     }
    }