Macro Use Case: Add an Array of SObject Names to Extract Workflow

Here’s a macro that adds an array of sObject names to the extract workflow.

Example 

Macro

1{
2    		"name" : "concatArrayFieldName",
3    		"description" : "Concatenates field names from an sobject array node",
4    		"parameters" :
5    		[
6    			"variable"
7    		],
8    		"returns": "${array:concat(Rules.CurrentNode, array:forEach(p.variable,'{\"name\":\"${var.fieldName}\"}'))}"
9    
10    	},
11    	{
12    		"name" : "addToExtractCaseWorkflow",
13    		"description" : "Adds array fields to Extract Case node",
14    		"parameters" :
15    		[
16    			"variable"
17    		],
18    		"actions": [
19    		 {
20    		 	"action": "set",
21          		"description": "put selected values for sfdcDigest in dataflow",
22          		"path": "$.workflowDefinition.Extract_Case.parameters.fields",
23          		"value" : "${macros:concatArrayFieldName(p.variable)}"
24          	}
25          	]
26    	}

Example 

Rule Calling the Macro

1{
2          "action": "eval",
3          "description": "put selected values for sfdcDigest in dataflow",
4          "value": "${macros:addToExtractCaseWorkflow(Variables.CaseMoreDims)}"
5        }