File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
force-app/main/default/classes Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ public with sharing class SplitStringInvocable {
2
+ @InvocableMethod(
3
+ label= ' Split String'
4
+ description = ' Given a string and a delimiter, return a collection of strings'
5
+ )
6
+ public static List <List <String >> SplitStringInvocable (
7
+ List <Request > requests
8
+ ) {
9
+ List <List <String >> output = new List <List <String >>();
10
+ for (Request req : requests ) {
11
+ output .add (req .inputText .split (req .delimiter ));
12
+ }
13
+ return output ;
14
+ }
15
+
16
+ public class Request {
17
+ @InvocableVariable(required= true label = ' Input Text' )
18
+ public String inputText ;
19
+ @InvocableVariable(
20
+ required= true
21
+ label = ' Separator'
22
+ description = ' The delimiter that separates blocks of text inside your Input Text.'
23
+ )
24
+ public String delimiter = ' ;' ;
25
+ }
26
+ }
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <ApexClass xmlns =" http://soap.sforce.com/2006/04/metadata" >
3
+ <apiVersion >59.0</apiVersion >
4
+ <status >Active</status >
5
+ </ApexClass >
You can’t perform that action at this time.
0 commit comments