I am trying to pass two variables from Flow to apex. One is a collection variable and another is just a string.
Collection Variable is passed in personIds
And Passing String in inputName
I am trying to loop on the Collection variable and update the name, But i am not able to access the input name, as i can only create one method for personIds.
global class lookupflowvars {
public with sharing class Requests {
@InvocableVariable(label='Records for Input' description='test' required=true)
public string inputName;
}
@InvocableMethod(label='Update Person Member Reference' description='Update MemberReference field on Person')
public static void UpdatePersonMemberReference(List<List<String>> personIds){
List<String> values = new List<String>();
for (List<String> subList : personIds) values.addAll(subList);
// List<Id> oppids= new List<Id>();
List<Opportunity> oppList = new List<Opportunity>();
oppList = [select id,Name__c from opportunity where id in :values];
for (Opportunity newopplist : oppList ){
newopplist.Name__c =inputName'; //cannot access inputName here!
update newopplist;
}
}
}
Cannot access inputName