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
Afrose AhamedAfrose Ahamed 

Why Apexaction flow setoutput variable not showing


Please anyone explain what is my mistakes here.
I Want to set output values from apex action.
public class flowinputs{
            @invocableVariable public String oppId;
           }
User-added image
As per above mentioned im getting oppId as input values from apex class.
But Store Output Values not showing  from my apex results  class oppsdetails, oppsdetail.
 
public class results{
            @invocableVariable public Decimal oppsdetails;
        public results(Decimal objname){this.oppsdetails=objname;}
          @invocableVariable public string oppsdetail;
        public results(string objnam){this.oppsdetail=objnam;}
        
    }

See below image output values not showing from apex class result oppdetails,oppdetail. In ouput i can't able to declare new resources also.
User-added image
Please refer the below my full apex code.
 
public class checksum {
    public class flowinputs{
            @invocableVariable public String oppId;
           
    }
    public class results{
            @invocableVariable public Decimal oppsdetails;
        public results(Decimal objname){this.oppsdetails=objname;}
          @invocableVariable public string oppsdetail;
        public results(string objnam){this.oppsdetail=objnam;}
        
    }
@invocableMethod
    public static list<list<results>> countSum(list<flowinputs> requests){
        list<list<results>> Wrapperclass=new list<list<results>>();
        list<results> Resultrecords=new list<results>();
        usd.add(Resultrecords);
        List<id> oppids = new list<Id>();       
        for(flowinputs request:requests)
        {
            oppids.add(request.oppId);
            
        }
        for(AggregateResult Qsum: [select Quote__r.id quoteid,Product__r.id prid,sum(Quantity__c) qunty from QuoteLine__c where Quote__r.id=: oppids group by Product__r.id,Quote__r.id]){
           String accid =(String)Qsum.get('quoteid');
            String acid =(String)Qsum.get('prid');
            Decimal quotesums=(Decimal)Qsum.get('qunty');
           // System.debug('accid' +accid);
            System.debug('sum'+quotesums);
            Resultrecords.add(new results(quotesums));
              Resultrecords.add(new results(acid));
            Resultrecords.add(new results(accid));
        }
            
return Wrapperclass;
    }
    
}
Getting outputs but unable to store set output values from apex class to  flow.
User-added image
I passed below like this also:
apex code:
public class checksum {
    public class flowinputs{
            @invocableVariable public String oppId;
           
    }
    public class results{
            @invocableVariable public Decimal oppsdetails;
        public results(Decimal objname){this.oppsdetails=objname;}
          @invocableVariable public string oppsdetail;
        public results(string objnam){this.oppsdetail=objnam;}
        
    }
@invocableMethod
    public static list<results> countSum(list<flowinputs> requests){
       
        list<results> RecordsResults=new list<results>();
      
        List<id> oppids = new list<Id>();       
        for(flowinputs request:requests)
        {
            oppids.add(request.oppId);
            
        }
        for(AggregateResult Qsum: [select Quote__r.id quoteid,Product__r.id prid,sum(Quantity__c) qunty from QuoteLine__c where Quote__r.id=: oppids group by Product__r.id,Quote__r.id]){
           String accid =(String)Qsum.get('quoteid');
            String acid =(String)Qsum.get('prid');
            Decimal quotesums=(Decimal)Qsum.get('qunty');
           // System.debug('accid' +accid);
            System.debug('sum'+quotesums);
            RecordsResults.add(new results(quotesums));
              RecordsResults.add(new results(acid));
            RecordsResults.add(new results(accid));
        }
            
return RecordsResults;
    }
    
}

for above mentioned apex code im getting Setoutput values as Oppdetails, oppdetail from apex class.
User-added image

When declaring variable to set this. Im getting error like this
User-added image

My Requirement is:
Invokable Contains an Input variable with for “input variable” to be passed from flow to the apex class Query all QuoteLine__c records that have the field Quote__c populated with the input variable record ID Group all returned records by the field Product__c, SUM all values in Quantity__c Return a collection variable containing the following values to be passed back to flow for further utilization. Quote ID Quote Line ID Product ID Quantity
 
Please anyone explain how can i acheive this.

Regards,
Afrose