Make for Make Newbies Video Series

I am undertaking a little exercise to explain the core features of Make using a scenario walkthrough and a related video. My hope is to record videos between 5-30 minutes long to explain Make to Make Newbies.

I am going to start with a topic which I think confuses just about everyone who starts using Make but has never programmed before:

Part 1: Exploring Data Structures for Make Newbies

In this video and accompanying scenario we will review simple arrays and more complex collections and arrays of collections. The interaction between the number of elements in an array and how bundles are created is also covered. Iterators are covered which can loop an array and generate processing loops in scenarios. The Parse JSON module is also introduced which is useful for parsing text which contains JSON into Make-friendly data structures.

Copy and Paste this blueprint into a new Make Scenario
{
    "subflows": [
        {
            "flow": [
                {
                    "id": 3,
                    "module": "util:SetVariables",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "variables": [
                            {
                                "name": "Simple array",
                                "value": "{{add(emptyarray; \"apple\"; \"banana\"; \"cherry\"; 42; true; now; null)}}"
                            },
                            {
                                "name": "JSON simple collection",
                                "value": "{\n    \"name\": \"Alex C\",\n    \"age\": 2,\n    \"city\": \"Houston\",\n    \"date_entered\": \"{{now}}\"\n}"
                            },
                            {
                                "name": "JSON array of simple collections",
                                "value": "[\n    {\n        \"name\": \"Alex C\",\n        \"age\": 53,\n        \"city\": \"Toronto\"\n    },\n    {\n        \"name\": \"Eric S\",\n        \"age\": 43,\n        \"city\": \"Hoboken\"\n    }\n]"
                            },
                            {
                                "name": "JSON collection complex values",
                                "value": "{\n\t\"name\": \"Aleix Melon\",\n\t\"id\": \"E00245\",\n\t\"role\": [\"Dev\", \"DBA\"],\n\t\"age\": 23,\n\t\"doj\": \"11-12-2019\",\n\t\"married\": {{false}},\n\t\"address\": {\n\t\t\"street\": \"32, Laham St.\",\n\t\t\"city\": \"Innsbruck\",\n\t\t\"country\": \"Austria\"\n\t},\n\t\"referred-by\": \"E0012\"\n}"
                            },
                            {
                                "name": "JSON array of collections complex values",
                                "value": "[\n\t{\n        \"name\": \"Aleix Melon\",\n        \"id\": \"E00245\",\n        \"role\": [\"Dev\", \"DBA\"],\n        \"age\": 23,\n        \"doj\": \"11-12-2019\",\n        \"married\": {{false}},\n        \"address\": {\n            \"street\": \"32, Laham St.\",\n            \"city\": \"Innsbruck\",\n            \"country\": \"Austria\"\n            },\n        \"referred-by\": \"E0012\"\n\t},\n{\n      \"name\": \"Bob Washington\",\n        \"id\": \"E01245\",\n        \"role\": [\"HR\"],\n        \"age\": 43,\n        \"doj\": \"10-06-2010\",\n        \"married\": {{true}},\n        \"address\": {\n            \"street\": \"45, Abraham Lane.\",\n            \"city\": \"Washington\",\n            \"country\": \"USA\"\n            },\n        \"referred-by\": \"\"\n\t}\n]"
                            },
                            {
                                "name": "JSON array of collections of really complex values",
                                "value": "[\n    {\n        \"item_name\": \"Email campaign\",\n        \"item_sku_attachment\": \"\",\n        \"item_options\": [\n            {\n                \"Organization name\": \"Client A\"\n            },\n            {\n                \"Writing services\": \"Writing service A\"\n            },\n            {\n                \"Design services\": \"Design service B\"\n            },\n            {\n                \"Comments\": \"test comment\"\n            }\n        ],\n        \"item_image\": \"image.png\",\n        \"unit_price\": 0,\n        \"quantity\": 5,\n        \"weight\": 0,\n        \"created_at\": \"2024-05-11 13:37:46\",\n        \"product_price\": 195,\n        \"categories\": [\n            {\n                \"id\": \"cat_6633e1936571b618828100\",\n                \"category_name\": \"Send\",\n                \"category_slug\": \"send\",\n                \"status\": \"1\"\n            }\n        ]\n    },\n    {\n        \"item_name\": \"Ad campaign\",\n        \"item_sku_attachment\": \"\",\n        \"item_options\": [\n            {\n                \"Organization name\": \"Client B\"\n            },\n            {\n                \"Writing services\": \"Writing service B\"\n            },\n            {\n                \"Design services\": \"Design service C\"\n            },\n            {\n                \"Comments\": \"test comment 2\"\n            }\n        ],\n        \"item_image\": \"image.png\",\n        \"unit_price\": 0,\n        \"quantity\": 5,\n        \"weight\": 0,\n        \"created_at\": \"2023-05-11 13:37:46\",\n        \"product_price\": 1295,\n        \"categories\": [\n            {\n                \"id\": \"cat_6633e1936571b618828100\",\n                \"category_name\": \"Send\",\n                \"category_slug\": \"send\",\n                \"status\": \"1\"\n            }\n        ]\n    }\n]"
                            }
                        ],
                        "scope": "roundtrip"
                    },
                    "metadata": {
                        "designer": {
                            "x": 0,
                            "y": 150
                        },
                        "restore": {
                            "expect": {
                                "variables": {
                                    "items": [
                                        null,
                                        null,
                                        null,
                                        null,
                                        null,
                                        null
                                    ]
                                },
                                "scope": {
                                    "label": "One cycle"
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "variables",
                                "type": "array",
                                "label": "Variables",
                                "spec": [
                                    {
                                        "name": "name",
                                        "label": "Variable name",
                                        "type": "text",
                                        "required": true
                                    },
                                    {
                                        "name": "value",
                                        "label": "Variable value",
                                        "type": "any"
                                    }
                                ]
                            },
                            {
                                "name": "scope",
                                "type": "select",
                                "label": "Variable lifetime",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "roundtrip",
                                        "execution"
                                    ]
                                }
                            }
                        ],
                        "interface": [
                            {
                                "name": "Simple array",
                                "label": "Simple array",
                                "type": "any"
                            },
                            {
                                "name": "JSON simple collection",
                                "label": "JSON simple collection",
                                "type": "any"
                            },
                            {
                                "name": "JSON array of simple collections",
                                "label": "JSON array of simple collections",
                                "type": "any"
                            },
                            {
                                "name": "JSON collection complex values",
                                "label": "JSON collection complex values",
                                "type": "any"
                            },
                            {
                                "name": "JSON array of collections complex values",
                                "label": "JSON array of collections complex values",
                                "type": "any"
                            },
                            {
                                "name": "JSON array of collections of really complex values",
                                "label": "JSON array of collections of really complex values",
                                "type": "any"
                            }
                        ]
                    }
                },
                {
                    "id": 5,
                    "module": "builtin:BasicFeeder",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "array": [
                            "{{3.`Simple array`}}",
                            "{{3.`JSON simple collection`}}",
                            "{{3.`JSON array of simple collections`}}",
                            "{{3.`JSON collection complex values`}}",
                            "{{3.`JSON array of collections complex values`}}",
                            "{{3.`JSON array of collections of really complex values`}}"
                        ]
                    },
                    "metadata": {
                        "designer": {
                            "x": 300,
                            "y": 150
                        },
                        "restore": {
                            "expect": {
                                "array": {
                                    "mode": "chose",
                                    "items": [
                                        null,
                                        null,
                                        null,
                                        null,
                                        null,
                                        null
                                    ]
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "array",
                                "type": "array",
                                "label": "Array",
                                "mode": "edit",
                                "spec": []
                            }
                        ]
                    }
                },
                {
                    "id": 6,
                    "module": "builtin:BasicRouter",
                    "version": 1,
                    "parameters": {
                        "else": 1
                    },
                    "mapper": null,
                    "metadata": {
                        "designer": {
                            "x": 600,
                            "y": 150
                        }
                    },
                    "routes": [
                        {
                            "flow": [
                                {
                                    "id": 2,
                                    "module": "builtin:BasicFeeder",
                                    "version": 1,
                                    "parameters": {},
                                    "filter": {
                                        "name": "First bundle",
                                        "conditions": [
                                            [
                                                {
                                                    "a": "{{5.`__IMTINDEX__`}}",
                                                    "o": "number:equal",
                                                    "b": "1"
                                                }
                                            ]
                                        ]
                                    },
                                    "mapper": {
                                        "array": "{{5.value}}"
                                    },
                                    "metadata": {
                                        "designer": {
                                            "x": 900,
                                            "y": 0,
                                            "messages": [
                                                {
                                                    "category": "last",
                                                    "severity": "warning",
                                                    "message": "A transformer should not be the last module in the route."
                                                }
                                            ]
                                        },
                                        "restore": {
                                            "expect": {
                                                "array": {
                                                    "mode": "edit",
                                                    "items": [
                                                        null,
                                                        null,
                                                        null,
                                                        null
                                                    ]
                                                }
                                            }
                                        },
                                        "expect": [
                                            {
                                                "name": "array",
                                                "type": "array",
                                                "label": "Array",
                                                "mode": "edit",
                                                "spec": []
                                            }
                                        ]
                                    }
                                }
                            ]
                        },
                        {
                            "flow": [
                                {
                                    "id": 7,
                                    "module": "json:ParseJSON",
                                    "version": 1,
                                    "parameters": {
                                        "type": ""
                                    },
                                    "mapper": {
                                        "json": "{{5.value}}"
                                    },
                                    "metadata": {
                                        "designer": {
                                            "x": 900,
                                            "y": 300,
                                            "messages": [
                                                {
                                                    "category": "last",
                                                    "severity": "warning",
                                                    "message": "A transformer should not be the last module in the route."
                                                }
                                            ]
                                        },
                                        "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
                                            }
                                        ]
                                    }
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}


Alex Sirota
Director of NewPath Consulting - we are :superhero: Make Heroes! :woman_superhero:t4:

:heart_on_fire: Check out my series of videos and scenario walkthroughs for Make Newbies :heart_on_fire:

My Solutions on Make Community

3 Likes

How exciting @alex.newpath! :clap: :clap: :clap:

This is a fantastic idea and an incredibly valuable initiative. Thank you so much for thinking of our Make newbies and for helping them explore the amazing possibilities Make offers! :star2:

Of course! The more Makers are successful with their projects the more automation they will attempt and hopefully succeed with. Refining your Make skills is like any other skill like playing a sport or a musical instrument. You gotta practice!

3 Likes

Here’s Part 2: Exploring Aggregators for Make Newbies

In this video we introduce a new complex JSON structure that describes mutiple library systems that can be used in future sessions related to array functions. We also compare Array Aggregators with array functions like merge(), join() and remove(). We apply these functions to our simplest array so you can get more familiar. This video is pretty short at just under 10 minutes long.

Copy and Paste this blueprint into a new Make Scenario
{
    "subflows": [
        {
            "flow": [
                {
                    "id": 3,
                    "module": "util:SetVariables",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "variables": [
                            {
                                "name": "Simple array",
                                "value": "{{add(emptyarray; \"apple\"; \"banana\"; \"cherry\"; 42; true; null; now)}}"
                            },
                            {
                                "name": "another simple array",
                                "value": "{{add(emptyarray; \"pear\"; \"mango\"; 123; false)}}"
                            },
                            {
                                "name": "JSON simple collection",
                                "value": "{\n    \"name\": \"Alex C\",\n    \"age\": 2,\n    \"city\": \"Houston\",\n    \"date_entered\": \"{{now}}\"\n}"
                            },
                            {
                                "name": "JSON array of simple collections",
                                "value": "[\n    {\n        \"name\": \"Alex C\",\n        \"age\": 53,\n        \"city\": \"Toronto\"\n    },\n    {\n        \"name\": \"Eric S\",\n        \"age\": 43,\n        \"city\": \"Hoboken\"\n    }\n]"
                            },
                            {
                                "name": "JSON collection complex values",
                                "value": "{\n\t\"name\": \"Aleix Melon\",\n\t\"id\": \"E00245\",\n\t\"role\": [\"Dev\", \"DBA\"],\n\t\"age\": 23,\n\t\"doj\": \"11-12-2019\",\n\t\"married\": {{false}},\n\t\"address\": {\n\t\t\"street\": \"32, Laham St.\",\n\t\t\"city\": \"Innsbruck\",\n\t\t\"country\": \"Austria\"\n\t},\n\t\"referred-by\": \"E0012\"\n}"
                            },
                            {
                                "name": "JSON array of collections complex values",
                                "value": "[\n\t{\n        \"name\": \"Aleix Melon\",\n        \"id\": \"E00245\",\n        \"role\": [\"Dev\", \"DBA\"],\n        \"age\": 23,\n        \"doj\": \"11-12-2019\",\n        \"married\": {{false}},\n        \"address\": {\n            \"street\": \"32, Laham St.\",\n            \"city\": \"Innsbruck\",\n            \"country\": \"Austria\"\n            },\n        \"referred-by\": \"E0012\"\n\t},\n{\n      \"name\": \"Bob Washington\",\n        \"id\": \"E01245\",\n        \"role\": [\"HR\"],\n        \"age\": 43,\n        \"doj\": \"10-06-2010\",\n        \"married\": {{true}},\n        \"address\": {\n            \"street\": \"45, Abraham Lane.\",\n            \"city\": \"Washington\",\n            \"country\": \"USA\"\n            },\n        \"referred-by\": \"\"\n\t}\n]"
                            },
                            {
                                "name": "JSON array of collections of really complex values",
                                "value": "[\n    {\n        \"item_name\": \"Email campaign\",\n        \"item_sku_attachment\": \"\",\n        \"item_options\": [\n            {\n                \"Organization name\": \"Client A\"\n            },\n            {\n                \"Writing services\": \"Writing service A\"\n            },\n            {\n                \"Design services\": \"Design service B\"\n            },\n            {\n                \"Comments\": \"test comment\"\n            }\n        ],\n        \"item_image\": \"image.png\",\n        \"unit_price\": 0,\n        \"quantity\": 5,\n        \"weight\": 0,\n        \"created_at\": \"2024-05-11 13:37:46\",\n        \"product_price\": 195,\n        \"categories\": [\n            {\n                \"id\": \"cat_6633e1936571b618828100\",\n                \"category_name\": \"Send\",\n                \"category_slug\": \"send\",\n                \"status\": \"1\"\n            }\n        ]\n    },\n    {\n        \"item_name\": \"Ad campaign\",\n        \"item_sku_attachment\": \"\",\n        \"item_options\": [\n            {\n                \"Organization name\": \"Client B\"\n            },\n            {\n                \"Writing services\": \"Writing service B\"\n            },\n            {\n                \"Design services\": \"Design service C\"\n            },\n            {\n                \"Comments\": \"test comment 2\"\n            }\n        ],\n        \"item_image\": \"image.png\",\n        \"unit_price\": 0,\n        \"quantity\": 5,\n        \"weight\": 0,\n        \"created_at\": \"2023-05-11 13:37:46\",\n        \"product_price\": 1295,\n        \"categories\": [\n            {\n                \"id\": \"cat_6633e1936571b618828100\",\n                \"category_name\": \"Send\",\n                \"category_slug\": \"send\",\n                \"status\": \"1\"\n            }\n        ]\n    }\n]"
                            },
                            {
                                "name": "JSON Library Systems",
                                "value": "[{\n  \"library\": {\n    \"name\": \"Central Library\",\n    \"location\": \"123 Main Street\",\n    \"catalog\": {\n      \"sections\": [\n        {\n          \"name\": \"Fiction\",\n          \"books\": [\n            {\n              \"title\": \"To Kill a Mockingbird\",\n              \"author\": \"Harper Lee\",\n              \"genre\": \"Classic\",\n              \"copies\": 5\n            },\n            {\n              \"title\": \"1984\",\n              \"author\": \"George Orwell\",\n              \"genre\": \"Dystopian\",\n              \"copies\": 3\n            }\n          ]\n        },\n        {\n          \"name\": \"Non-Fiction\",\n          \"books\": [\n            {\n              \"title\": \"Sapiens: A Brief History of Humankind\",\n              \"author\": \"Yuval Noah Harari\",\n              \"genre\": \"History\",\n              \"copies\": 7\n            },\n            {\n              \"title\": \"The Power of Habit\",\n              \"author\": \"Charles Duhigg\",\n              \"genre\": \"Psychology\",\n              \"copies\": 4\n            }\n          ]\n        }\n      ]\n    }\n  }\n},\n{\n  \"library\": {\n    \"name\": \"Downtown Library\",\n    \"location\": \"456 Elm Street\",\n    \"catalog\": {\n      \"sections\": [\n        {\n          \"name\": \"Science Fiction\",\n          \"books\": [\n            {\n              \"title\": \"Dune\",\n              \"author\": \"Frank Herbert\",\n              \"genre\": \"Science Fiction\",\n              \"copies\": 6\n            },\n            {\n              \"title\": \"Neuromancer\",\n              \"author\": \"William Gibson\",\n              \"genre\": \"Cyberpunk\",\n              \"copies\": 4\n            }\n          ]\n        },\n        {\n          \"name\": \"Biography\",\n          \"books\": [\n            {\n              \"title\": \"Steve Jobs\",\n              \"author\": \"Walter Isaacson\",\n              \"genre\": \"Biography\",\n              \"copies\": 3\n            },\n            {\n              \"title\": \"The Diary of a Young Girl\",\n              \"author\": \"Anne Frank\",\n              \"genre\": \"Autobiography\",\n              \"copies\": 5\n            }\n          ]\n        }\n      ]\n    }\n  }\n},\n{\n  \"library\": {\n    \"name\": \"Westside Library\",\n    \"location\": \"789 Oak Avenue\",\n    \"catalog\": {\n      \"sections\": [\n        {\n          \"name\": \"Mystery\",\n          \"books\": [\n            {\n              \"title\": \"The Girl with the Dragon Tattoo\",\n              \"author\": \"Stieg Larsson\",\n              \"genre\": \"Mystery\",\n              \"copies\": 8\n            },\n            {\n              \"title\": \"Gone Girl\",\n              \"author\": \"Gillian Flynn\",\n              \"genre\": \"Thriller\",\n              \"copies\": 6\n            }\n          ]\n        },\n        {\n          \"name\": \"History\",\n          \"books\": [\n            {\n              \"title\": \"The Guns of August\",\n              \"author\": \"Barbara W. Tuchman\",\n              \"genre\": \"History\",\n              \"copies\": 4\n            },\n            {\n              \"title\": \"1491\",\n              \"author\": \"Charles C. Mann\",\n              \"genre\": \"Archaeology\",\n              \"copies\": 7\n            }\n          ]\n        }\n      ]\n    }\n  }\n},\n{\n  \"library\": {\n    \"name\": \"Eastside Library\",\n    \"location\": \"1010 Pine Boulevard\",\n    \"catalog\": {\n      \"sections\": [\n        {\n          \"name\": \"Fantasy\",\n          \"books\": [\n            {\n              \"title\": \"Harry Potter and the Philosopher's Stone\",\n              \"author\": \"J.K. Rowling\",\n              \"genre\": \"Fantasy\",\n              \"copies\": 10\n            },\n            {\n              \"title\": \"The Hobbit\",\n              \"author\": \"J.R.R. Tolkien\",\n              \"genre\": \"Adventure\",\n              \"copies\": 8\n            }\n          ]\n        },\n        {\n          \"name\": \"Self-Help\",\n          \"books\": [\n            {\n              \"title\": \"The Subtle Art of Not Giving a F*ck\",\n              \"author\": \"Mark Manson\",\n              \"genre\": \"Self-Help\",\n              \"copies\": 5\n            },\n            {\n              \"title\": \"Atomic Habits\",\n              \"author\": \"James Clear\",\n              \"genre\": \"Personal Development\",\n              \"copies\": 6\n            }\n          ]\n        }\n      ]\n    }\n  }\n},\n{\n  \"library\": {\n    \"name\": \"Southside Library\",\n    \"location\": \"1212 Maple Street\",\n    \"catalog\": {\n      \"sections\": [\n        {\n          \"name\": \"Fantasy\",\n          \"books\": [\n            {\n              \"title\": \"The Name of the Wind\",\n              \"author\": \"Patrick Rothfuss\",\n              \"genre\": \"Fantasy\",\n              \"copies\": 7\n            },\n            {\n              \"title\": \"Mistborn: The Final Empire\",\n              \"author\": \"Brandon Sanderson\",\n              \"genre\": \"Fantasy\",\n              \"copies\": 6\n            }\n          ]\n        },\n        {\n          \"name\": \"Self-Help\",\n          \"books\": [\n            {\n              \"title\": \"The 7 Habits of Highly Effective People\",\n              \"author\": \"Stephen R. Covey\",\n              \"genre\": \"Self-Help\",\n              \"copies\": 8\n            },\n            {\n              \"title\": \"How to Win Friends and Influence People\",\n              \"author\": \"Dale Carnegie\",\n              \"genre\": \"Self-Help\",\n              \"copies\": 9\n            }\n          ]\n        }\n      ]\n    }\n  }\n}\n]"
                            }
                        ],
                        "scope": "roundtrip"
                    },
                    "metadata": {
                        "designer": {
                            "x": 0,
                            "y": 150
                        },
                        "restore": {
                            "expect": {
                                "variables": {
                                    "items": [
                                        null,
                                        null,
                                        null,
                                        null,
                                        null,
                                        null,
                                        null,
                                        null
                                    ]
                                },
                                "scope": {
                                    "label": "One cycle"
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "variables",
                                "type": "array",
                                "label": "Variables",
                                "spec": [
                                    {
                                        "name": "name",
                                        "label": "Variable name",
                                        "type": "text",
                                        "required": true
                                    },
                                    {
                                        "name": "value",
                                        "label": "Variable value",
                                        "type": "any"
                                    }
                                ]
                            },
                            {
                                "name": "scope",
                                "type": "select",
                                "label": "Variable lifetime",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "roundtrip",
                                        "execution"
                                    ]
                                }
                            }
                        ],
                        "interface": [
                            {
                                "name": "Simple array",
                                "label": "Simple array",
                                "type": "any"
                            },
                            {
                                "name": "another simple array",
                                "label": "another simple array",
                                "type": "any"
                            },
                            {
                                "name": "JSON simple collection",
                                "label": "JSON simple collection",
                                "type": "any"
                            },
                            {
                                "name": "JSON array of simple collections",
                                "label": "JSON array of simple collections",
                                "type": "any"
                            },
                            {
                                "name": "JSON collection complex values",
                                "label": "JSON collection complex values",
                                "type": "any"
                            },
                            {
                                "name": "JSON array of collections complex values",
                                "label": "JSON array of collections complex values",
                                "type": "any"
                            },
                            {
                                "name": "JSON array of collections of really complex values",
                                "label": "JSON array of collections of really complex values",
                                "type": "any"
                            },
                            {
                                "name": "JSON Library Systems",
                                "label": "JSON Library Systems",
                                "type": "any"
                            }
                        ]
                    }
                },
                {
                    "id": 5,
                    "module": "builtin:BasicFeeder",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "array": [
                            "{{3.`Simple array`}}",
                            "{{3.`another simple array`}}",
                            "{{3.`JSON simple collection`}}",
                            "{{3.`JSON array of simple collections`}}",
                            "{{3.`JSON collection complex values`}}",
                            "{{3.`JSON array of collections complex values`}}",
                            "{{3.`JSON array of collections of really complex values`}}",
                            "{{3.`JSON Library Systems`}}"
                        ]
                    },
                    "metadata": {
                        "designer": {
                            "x": 300,
                            "y": 150
                        },
                        "restore": {
                            "expect": {
                                "array": {
                                    "mode": "chose",
                                    "items": [
                                        null,
                                        null,
                                        null,
                                        null,
                                        null,
                                        null,
                                        null,
                                        null
                                    ]
                                }
                            }
                        },
                        "expect": [
                            {
                                "mode": "edit",
                                "name": "array",
                                "spec": [],
                                "type": "array",
                                "label": "Array"
                            }
                        ]
                    }
                },
                {
                    "id": 6,
                    "module": "builtin:BasicRouter",
                    "version": 1,
                    "parameters": {
                        "else": 1
                    },
                    "mapper": null,
                    "metadata": {
                        "designer": {
                            "x": 600,
                            "y": 150
                        }
                    },
                    "routes": [
                        {
                            "flow": [
                                {
                                    "id": 2,
                                    "module": "builtin:BasicFeeder",
                                    "version": 1,
                                    "parameters": {},
                                    "filter": {
                                        "name": "First or second bundle",
                                        "conditions": [
                                            [
                                                {
                                                    "a": "{{5.`__IMTINDEX__`}}",
                                                    "b": "1",
                                                    "o": "number:equal"
                                                }
                                            ],
                                            [
                                                {
                                                    "a": "{{5.`__IMTINDEX__`}}",
                                                    "b": "2",
                                                    "o": "number:equal"
                                                }
                                            ]
                                        ]
                                    },
                                    "mapper": {
                                        "array": "{{5.value}}"
                                    },
                                    "metadata": {
                                        "designer": {
                                            "x": 900,
                                            "y": 0
                                        },
                                        "restore": {
                                            "expect": {
                                                "array": {
                                                    "mode": "edit",
                                                    "items": [
                                                        null,
                                                        null,
                                                        null,
                                                        null
                                                    ]
                                                }
                                            }
                                        },
                                        "expect": [
                                            {
                                                "mode": "edit",
                                                "name": "array",
                                                "spec": [],
                                                "type": "array",
                                                "label": "Array"
                                            }
                                        ]
                                    }
                                },
                                {
                                    "id": 9,
                                    "module": "builtin:BasicAggregator",
                                    "version": 1,
                                    "parameters": {
                                        "feeder": 5
                                    },
                                    "mapper": {
                                        "value": "{{2.value}}"
                                    },
                                    "metadata": {
                                        "designer": {
                                            "x": 1200,
                                            "y": 0
                                        },
                                        "restore": {
                                            "extra": {
                                                "feeder": {
                                                    "label": "Iterator [5]"
                                                },
                                                "target": {
                                                    "label": "Custom"
                                                }
                                            }
                                        }
                                    }
                                },
                                {
                                    "id": 10,
                                    "module": "util:SetVariables",
                                    "version": 1,
                                    "parameters": {},
                                    "mapper": {
                                        "variables": [
                                            {
                                                "name": "merged array",
                                                "value": "{{merge(3.`Simple array`; 3.`another simple array`)}}"
                                            },
                                            {
                                                "name": "Array as a string with delimiters",
                                                "value": "{{join(remove(3.`Simple array`; null); \",\" + space)}}"
                                            }
                                        ],
                                        "scope": "roundtrip"
                                    },
                                    "metadata": {
                                        "designer": {
                                            "x": 1500,
                                            "y": 0
                                        },
                                        "restore": {
                                            "expect": {
                                                "variables": {
                                                    "items": [
                                                        null,
                                                        null
                                                    ]
                                                },
                                                "scope": {
                                                    "label": "One cycle"
                                                }
                                            }
                                        },
                                        "expect": [
                                            {
                                                "name": "variables",
                                                "type": "array",
                                                "label": "Variables",
                                                "spec": [
                                                    {
                                                        "name": "name",
                                                        "label": "Variable name",
                                                        "type": "text",
                                                        "required": true
                                                    },
                                                    {
                                                        "name": "value",
                                                        "label": "Variable value",
                                                        "type": "any"
                                                    }
                                                ]
                                            },
                                            {
                                                "name": "scope",
                                                "type": "select",
                                                "label": "Variable lifetime",
                                                "required": true,
                                                "validate": {
                                                    "enum": [
                                                        "roundtrip",
                                                        "execution"
                                                    ]
                                                }
                                            }
                                        ],
                                        "interface": [
                                            {
                                                "name": "merged array",
                                                "label": "merged array",
                                                "type": "any"
                                            },
                                            {
                                                "name": "Array as a string with delimiters",
                                                "label": "Array as a string with delimiters",
                                                "type": "any"
                                            }
                                        ]
                                    }
                                }
                            ]
                        },
                        {
                            "flow": [
                                {
                                    "id": 7,
                                    "module": "json:ParseJSON",
                                    "version": 1,
                                    "parameters": {
                                        "type": ""
                                    },
                                    "mapper": {
                                        "json": "{{5.value}}"
                                    },
                                    "metadata": {
                                        "designer": {
                                            "x": 900,
                                            "y": 300,
                                            "messages": [
                                                {
                                                    "category": "last",
                                                    "severity": "warning",
                                                    "message": "A transformer should not be the last module in the route."
                                                }
                                            ]
                                        },
                                        "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
                                            }
                                        ]
                                    }
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}
2 Likes

Here’s Part 3: Exploring Array Functions and Text Aggregators for Make Newbies - Part A

In this video we describe sevearl useful array functions like first() and last(). We also look at how to reference a particular element of an array by index using 2 methods - using dot notation and with the “star” UI element picker. We also look at how to reference values from a collection coming out of an array aggregator. This Make help file is of relevance.

Download the Make blueprint and use the Import Blueprint to create a new scenario:

3. Exploring Array Functions and Text Aggregators for Make Newbies.json (39.8 KB)

2 Likes