In my Process Builder, on creation of my custom Object Bank__c record, I want to pass two parameters(Ids, objectApIName) to InvocableMethod in Apex class, so I added this to my code,

public static List<Id> idList = new List<Id>();
public class Request{
    public List<Id> ids;
    public String objectAPIName;

public static void mergeAccounts(Request[] requests) {
    String objectAPIName; // Object API Name
    for (Request mp : requests) {                
        objectAPIName = mp.objectAPIName;

But when I am trying to add "ids" variable with RecordId in Process Builder it is giving me this error "The input parameter "ids" can accept multiple values, so the assigned value must be a flow variable with the isCollection property set to true."

Is there any way I can pass the RecordId's into my Apex class just from PB instead of also using Flow. Let me know. Thank you!

1 Answer 1


You can't. You'd have to change the variable to Id instead of List<Id>.

  • Thanks Sfdxfox.. if I just add Id, can you suggest me how can I modify my code to add that Id into List<id> I want to add "public Id ids;" to "public static List<Id> idList = new List<Id>();" this list?
    – user62694
    Apr 12, 2020 at 6:24
  • @user62694 You would iterate through the Request array and get the ID values from each. This is how the bulkification works for the flow engine.
    – sfdcfox
    Apr 12, 2020 at 7:27
  • Got it, thank you so much!!
    – user62694
    Apr 12, 2020 at 8:01

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.