I am calling a Flow from Apex as below. In Flow I am running a duplicate check. If there is a duplicate I am saving it into a Variable that is marked as Available for output. How the return value is null. Has anyone had experience with return values from Flows?

        Flow.Interview.Duplicate_Payee_Check DupeCheck = new Flow.Interview.Duplicate_Payee_Check (params);

    // Obtain the results
    String returnValue = (String) DupeCheck.getVariableValue('ReturnValue');
    System.debug('Flow returned ' + returnValue);

1 Answer 1


I'm going to (intelligently) guess that the issue is the variable in the flow is not the same spelling/case of ReturnValue. For example, if the flow defines the output variable as returnValue the getVariableValue('ReturnValue') method will return null

See SFDC doc on flow variables

You must log in to answer this question.

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