Yes, that is possible. You’ll need a minimum of three modules:
Click to Expand Module Export Code
JSON - Copy and Paste this directly in the scenario editor
{
"subflows": [
{
"flow": [
{
"id": 182,
"module": "util:ComposeTransformer",
"version": 1,
"parameters": {},
"mapper": {
"value": "2x Product A\n1x Product B\n3x Product C\n3x Product A\n1x Product C"
},
"metadata": {
"designer": {
"x": 1240,
"y": -2337
},
"restore": {},
"expect": [
{
"name": "value",
"type": "text",
"label": "Text"
}
]
}
},
{
"id": 183,
"module": "regexp:Parser",
"version": 1,
"parameters": {
"pattern": "(?<num>\\d+)x (?<product>.+)",
"global": true,
"sensitive": true,
"multiline": false,
"singleline": false,
"continueWhenNoRes": false,
"ignoreInfiniteLoopsWhenGlobal": false
},
"mapper": {
"text": "{{182.value}}"
},
"metadata": {
"designer": {
"x": 1484,
"y": -2340
},
"restore": {},
"parameters": [
{
"name": "pattern",
"type": "text",
"label": "Pattern",
"required": true
},
{
"name": "global",
"type": "boolean",
"label": "Global match",
"required": true
},
{
"name": "sensitive",
"type": "boolean",
"label": "Case sensitive",
"required": true
},
{
"name": "multiline",
"type": "boolean",
"label": "Multiline",
"required": true
},
{
"name": "singleline",
"type": "boolean",
"label": "Singleline",
"required": true
},
{
"name": "continueWhenNoRes",
"type": "boolean",
"label": "Continue the execution of the route even if the module finds no matches",
"required": true
},
{
"name": "ignoreInfiniteLoopsWhenGlobal",
"type": "boolean",
"label": "Ignore errors when there is an infinite search loop",
"required": true
}
],
"expect": [
{
"name": "text",
"type": "text",
"label": "Text"
}
],
"interface": [
{
"type": "text",
"name": "num",
"label": "num"
},
{
"type": "text",
"name": "product",
"label": "product"
},
{
"type": "uinteger",
"name": "i",
"label": "i"
},
{
"type": "any",
"name": "__IMTMATCH__",
"label": "Fallback Match"
}
]
}
},
{
"id": 184,
"module": "util:FunctionAggregator2",
"version": 1,
"parameters": {
"fn": "sum",
"feeder": 183
},
"mapper": {
"value": "{{183.num}}"
},
"metadata": {
"designer": {
"x": 1727,
"y": -2341
},
"restore": {
"parameters": {
"fn": {
"label": "SUM"
}
},
"extra": {
"feeder": {
"label": "Text parser - Match pattern [183]"
}
}
},
"parameters": [
{
"name": "fn",
"type": "select",
"label": "Aggregate function",
"required": true,
"validate": {
"enum": [
"avg",
"sum",
"count",
"max",
"min"
]
}
}
],
"expect": [
{
"name": "value",
"type": "number",
"label": "Value"
}
],
"advanced": true
},
"flags": {
"groupBy": "{{183.product}}"
}
},
{
"id": 185,
"module": "util:TextAggregator",
"version": 1,
"parameters": {
"rowSeparator": "\n",
"feeder": 184
},
"mapper": {
"value": "{{184.result}}x {{184.`__IMTKEY__`}}"
},
"metadata": {
"designer": {
"x": 1970,
"y": -2340,
"messages": [
{
"category": "last",
"severity": "warning",
"message": "A transformer should not be the last module in the route."
}
]
},
"restore": {
"parameters": {
"rowSeparator": {
"label": "New row"
}
},
"extra": {
"feeder": {
"label": "Tools - Numeric aggregator [184]"
}
},
"flags": {
"groupBy": {
"collapsed": true
},
"stopIfEmpty": {
"collapsed": true
}
}
},
"parameters": [
{
"name": "rowSeparator",
"type": "select",
"label": "Row separator",
"validate": {
"enum": [
"\n",
"\t",
"other"
]
}
}
],
"expect": [
{
"name": "value",
"type": "text",
"label": "Text"
}
],
"advanced": true
}
}
]
}
],
"metadata": {
"version": 1
}
}
Hope this helps! Let me know if there are any further questions or issues.