Iam trying to get the list of sObject(Account, Case etc.,) and display in the screen flow picklist field.
For this i wrote the below method to get the List of Sobject.
@InvocableMethod(label='Get SObject API Names')
public static List<List<String>> getSObjectAPINames() {
List<List<String>> sObjectAPINames = new List<List<String>>();
List<String> objectAPINames = new List<String>();
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
for(Schema.SObjectType st : gd.values()) {
if(st.getDescribe().isAccessible()) {
objectAPINames.add(st.getDescribe().getName());
}
}
sObjectAPINames.add(objectAPINames);
return sObjectAPINames;
}
Note: Iam new to Salesforce flow.
Approach what I am trying is, call the above method from the flow and display the value in the picklist field.