You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.
-
Copy the code below by clicking the copy button when you mouseover the top-right of the code block
-
Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV to paste in the canvas.
-
Click on each imported module and save it. You may need to remap some variables.
Modules JSON Export
{
"subflows": [
{
"flow": [
{
"id": 33,
"module": "json:ParseJSON",
"version": 1,
"parameters": {
"type": ""
},
"mapper": {
"json": "[\n {\n \"id\": \"evt_59eb24470c6d44c6965351c23a497955\",\n \"eventType\": \"dailyWorkout.completed\",\n \"created\": \"2024-02-11 11:41:47\",\n \"data\": {\n \"userID\": 4045219,\n \"email\": \"jhumble@live.com\",\n \"dailyWorkoutID\": 589865419,\n \"workoutName\": \"Leg Day Workout\",\n \"status\": \"tracked\",\n \"unitWeight\": \"lbs\",\n \"unitDistance\": \"km\",\n \"brokenRecords\": [\n {\n \"dailyExerciseID\": 4485835765,\n \"exerciseID\": 7728964,\n \"name\": \"Leg Press\",\n \"recordType\": \"strength\",\n \"bestStats\": {\n \"threeRepMax\": 1200,\n \"threeRepMaxIncrease\": 650,\n \"fiveRepMax\": 999,\n \"fiveRepMaxIncrease\": 444,\n \"tenRepMax\": 700,\n \"tenRepMaxIncrease\": 445,\n \"maxLoad\": 20595,\n \"maxLoadIncrease\": 9075\n }\n },\n {\n \"dailyExerciseID\": 4485835766,\n \"exerciseID\": 6821509,\n \"name\": \"Dumbbell Walking Lunges\",\n \"recordType\": \"strength\",\n \"bestStats\": {\n \"maxWeight\": 75,\n \"maxWeightIncrease\": 5,\n \"maxLoad\": 4875,\n \"maxLoadIncrease\": 255\n }\n },\n {\n \"dailyExerciseID\": 4485835767,\n \"exerciseID\": 8830506,\n \"name\": \"Machine Lying Leg Curl\",\n \"recordType\": \"strength\",\n \"bestStats\": {\n \"maxWeight\": 180,\n \"maxWeightIncrease\": 20,\n \"maxLoad\": 7950,\n \"maxLoadIncrease\": 2370\n }\n }\n ]\n }\n }\n]"
},
"metadata": {
"designer": {
"x": 150,
"y": -1353
},
"restore": {
"parameters": {
"type": {
"label": "Choose a data structure"
}
}
},
"parameters": [
{
"name": "type",
"type": "udt",
"label": "Data structure"
}
],
"expect": [
{
"name": "json",
"type": "text",
"label": "JSON string",
"required": true
}
]
}
},
{
"id": 35,
"module": "builtin:BasicFeeder",
"version": 1,
"parameters": {},
"mapper": {
"array": "{{33.data.brokenRecords}}"
},
"metadata": {
"designer": {
"x": 393,
"y": -1351,
"name": "Iterate Broken Records"
},
"restore": {
"expect": {
"array": {
"mode": "edit"
}
}
},
"expect": [
{
"name": "array",
"type": "array",
"label": "Array",
"mode": "edit",
"spec": []
}
]
}
},
{
"id": 36,
"module": "util:FunctionAggregator2",
"version": 1,
"parameters": {
"fn": "sum",
"feeder": 35
},
"mapper": {
"value": "{{length(keys(35.bestStats)) / 2}}"
},
"metadata": {
"designer": {
"x": 638,
"y": -1351,
"name": "Sum Records",
"messages": [
{
"category": "last",
"severity": "warning",
"message": "A transformer should not be the last module in the route."
}
]
},
"restore": {
"parameters": {
"fn": {
"label": "SUM"
}
},
"extra": {
"feeder": {
"label": "Iterate Broken Records [35]"
}
}
},
"parameters": [
{
"name": "fn",
"type": "select",
"label": "Aggregate function",
"required": true,
"validate": {
"enum": [
"avg",
"sum",
"count",
"max",
"min"
]
}
}
],
"expect": [
{
"name": "value",
"type": "number",
"label": "Value"
}
]
}
}
]
}
],
"metadata": {
"version": 1
}
}