[SalesForce] Can we get the Result of @InvocableMethod method in Process Builder or use that output for further decision?

I am calling the @InvocableMethod from the Process Builder and @InvocableMethod method is returning the result, how can I take the result and use in Process Builder?

public class GetAccountUsingPhone {

    @InvocableMethod
    public static List<Account> getAccountsUsingPhone(List<String> phones){
        System.debug('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
        System.debug('Phone Values :: '+phones);
        List<Account> accounts = [select Id, Name, AccountNumber, Phone from Account where Phone=:phones];
        System.debug('Accounts :: '+accounts);
        return accounts;
    }
}

enter image description here

Best Answer

I think it is not possible to get value returned by apex. Go through the link given below.return values from process flow

but you can update some of your object fields that you can use in process builder.

Related Topic