How to split objects into 2

image

I have a form for order placement on Webflow. When I get a submission, I get it in the format of “SKU:OrderQuantity” (as pictured)

I would like to split this into multiple items to look like this
-LineItem
1
SKU:24AP-01628-COREXS
OrderQuantity:1
2
SKU:24AP-01628-CORESS
OrderQuantity:2

…and so on

I thought I’d do that with the get map functions but I can’t get it to work.

If anyone could point me in the right direction I’d greatly appreciate

Welcome to the Make community!

Please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.
Screenshot_2023-10-06_141025

A.

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

Uploading them here will look like this:

module-1-input-bundle.txt (12.3 KB)
module-1-output-bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

This will allow others to better assist you. Thanks!

2 Likes
[
    {
        "id": "65ddc684ff6880c725e37d18",
        "formId": "65ce73c2702a9cba293a6baf",
        "displayName": "Email Form",
        "siteId": "65ce5fbe2c7aaf3eca7da22f",
        "workspaceId": "657d2979b1ac103f4c610932",
        "formResponse": {
            "Name": "Miguel",
            "Email": "******@gmail.com",
            "Field": "99780*****",
            "24AP-01628-COREXS": "1",
            "24AP-01628-CORESS": "2",
            "24AP-01628-COREMM": "3",
            "24AP-01628-CORELL": "4",
            "24AP-01628-COREXL": "5",
            "24AP-01628-COVIXS": "6",
            "24AP-01628-COVISS": "7",
            "24AP-01628-COVIMM": "8",
            "24AP-01628-COVILL": "9",
            "24AP-01628-COVIXL": "10",
            "24AP-01628-COVEXS": "11",
            "24AP-01628-COVESS": "12",
            "24AP-01628-COVEMM": "13",
            "24AP-01628-COVELL": "14",
            "24AP-01628-COVEXL": "15",
            "24AP-01642-COBKXS": "16",
            "24AP-01642-COBKSS": "17",
            "24AP-01642-COBKMM": "18",
            "24AP-01642-COBKLL": "19",
            "24AP-01642-COBKXL": "20",
            "24AP-01642-COWHXS": "21",
            "24AP-01642-COWHSS": "22",
            "24AP-01642-COWHMM": "23",
            "24AP-01642-COWHLL": "24",
            "24AP-01642-COWHXL": "25",
            "24AP-01642-COPKXS": "26",
            "24AP-01642-COPKSS": "27",
            "24AP-01642-COPKMM": "28",
            "24AP-01642-COPKLL": "29",
            "24AP-01642-COPKXL": "30",
            "24AP-01643-COLAXS": "31",
            "24AP-01643-COLASS": "32",
            "24AP-01643-COLAMM": "33",
            "24AP-01643-COLALL": "34",
            "24AP-01643-COLAXL": "35",
            "24AP-01643-COWHXS": "36",
            "24AP-01643-COWHSS": "37",
            "24AP-01643-COWHMM": "38",
            "24AP-01643-COWHLL": "39",
            "24AP-01643-COWHXL": "40",
            "24AP-01647-COBKXS": "41",
            "24AP-01647-COBKSS": "42",
            "24AP-01647-COBKMM": "43",
            "24AP-01647-COBKLL": "44",
            "24AP-01647-COBKXL": "45",
            "24AP-01647-COBKXX": "46",
            "24AP-01647-COWHXS": "47",
            "24AP-01647-COWHSS": "48",
            "24AP-01647-COWHMM": "49",
            "24AP-01647-COWHLL": "50",
            "24AP-01647-COWHXL": "51",
            "24AP-01647-COWHXX": "52",
            "24AP-01647-COLAXS": "53",
            "24AP-01647-COLASS": "54",
            "24AP-01647-COLAMM": "55",
            "24AP-01647-COLALL": "56",
            "24AP-01647-COLAXL": "57",
            "24AP-01647-COLAXX": "58",
            "24AP-01629-COALXS": "59",
            "24AP-01629-COALSS": "60",
            "24AP-01629-COALMM": "61",
            "24AP-01629-COALLL": "62",
            "24AP-01629-COALXL": "63",
            "24AP-01629-COALXX": "64",
            "24AP-01629-COCEXS": "65",
            "24AP-01629-COCESS": "66",
            "24AP-01629-COCEMM": "67",
            "24AP-01629-COCELL": "68",
            "24AP-01629-COCEXL": "69",
            "24AP-01629-COCEXX": "70",
            "24AP-01629-COREXS": "71",
            "24AP-01629-CORESS": "72",
            "24AP-01629-COREMM": "73",
            "24AP-01629-CORELL": "74",
            "24AP-01629-COREXL": "75",
            "24AP-01629-COREXX": "76",
            "24AP-01629-COSAXS": "77",
            "24AP-01629-COSASS": "78",
            "24AP-01629-COSAMM": "79",
            "24AP-01629-COSALL": "80",
            "24AP-01629-COSAXL": "81",
            "24AP-01629-COSAXX": "82",
            "24AP-01629-COVIXS": "83",
            "24AP-01629-COVISS": "84",
            "24AP-01629-COVIMM": "85",
            "24AP-01629-COVILL": "86",
            "24AP-01629-COVIXL": "87",
            "24AP-01629-COVIXX": "88",
            "24AP-01645-COBKXS": "89",
            "24AP-01645-COBKSS": "90",
            "24AP-01645-COBKMM": "91",
            "24AP-01645-COBKLL": "92",
            "24AP-01645-COBKXL": "93",
            "24AP-01645-COBKXX": "94",
            "24AP-01645-COWHXS": "95",
            "24AP-01645-COWHSS": "96",
            "24AP-01645-COWHMM": "97",
            "24AP-01645-COWHLL": "98",
            "24AP-01645-COWHXL": "99",
            "24AP-01645-COWHXX": "100",
            "24AP-01645-COMUXS": "101",
            "24AP-01645-COMUSS": "102",
            "24AP-01645-COMUMM": "103",
            "24AP-01645-COMULL": "104",
            "24AP-01645-COMUXL": "105",
            "24AP-01645-COMUXX": "106",
            "24AP-01625-COCEXS": "107",
            "24AP-01625-COCESS": "108",
            "24AP-01625-COCEMM": "109",
            "24AP-01625-COCELL": "110",
            "24AP-01625-COCEXL": "111",
            "24AP-01625-COCEXX": "112",
            "24AP-01625-COREXS": "113",
            "24AP-01625-CORESS": "114",
            "24AP-01625-COREMM": "115",
            "24AP-01625-CORELL": "116",
            "24AP-01625-COREXL": "117",
            "24AP-01625-COREXX": "118",
            "24AP-01625-COSAXS": "119",
            "24AP-01625-COSASS": "120",
            "24AP-01625-COSAMM": "121",
            "24AP-01625-COSALL": "122",
            "24AP-01625-COSAXL": "123",
            "24AP-01625-COSAXX": "124",
            "24AP-01625-COVIXS": "125",
            "24AP-01625-COVISS": "126",
            "24AP-01625-COVIMM": "127",
            "24AP-01625-COVILL": "128",
            "24AP-01625-COVIXL": "129",
            "24AP-01625-COVIXX": "130",
            "24AP-01625-COALXS": "131",
            "24AP-01625-COALSS": "132",
            "24AP-01625-COALMM": "133",
            "24AP-01625-COALLL": "134",
            "24AP-01625-COALXL": "135",
            "24AP-01625-COALXX": "136",
            "24AP-01656-COBKXS": "137",
            "24AP-01656-COBKSS": "138",
            "24AP-01656-COBKMM": "139",
            "24AP-01656-COBKLL": "140",
            "24AP-01656-COBKXL": "141",
            "24AP-01656-COBKXX": "142",
            "24AP-01656-COLAXS": "143",
            "24AP-01656-COLASS": "144",
            "24AP-01656-COLAMM": "145",
            "24AP-01656-COLALL": "146",
            "24AP-01656-COLAXL": "147",
            "24AP-01656-COLAXX": "148",
            "24AP-01656-COWHXS": "149",
            "24AP-01656-COWHSS": "150",
            "24AP-01656-COWHMM": "151",
            "24AP-01656-COWHLL": "152",
            "24AP-01656-COWHXL": "153",
            "24AP-01656-COWHXX": "154",
            "24AP-01658-COBKXS": "155",
            "24AP-01658-COBKSS": "156",
            "24AP-01658-COBKMM": "157",
            "24AP-01658-COBKLL": "158",
            "24AP-01658-COBKXL": "159",
            "24AP-01658-COBKXX": "160",
            "24AP-01658-COLAXS": "161",
            "24AP-01658-COLASS": "162",
            "24AP-01658-COLAMM": "163",
            "24AP-01658-COLALL": "164",
            "24AP-01658-COLAXL": "165",
            "24AP-01658-COLAXX": "166",
            "24AP-01658-COWHXS": "167",
            "24AP-01658-COWHSS": "168",
            "24AP-01658-COWHMM": "169",
            "24AP-01658-COWHLL": "170",
            "24AP-01658-COWHXL": "171",
            "24AP-01658-COWHXX": "172",
            "24PA-01655-COBKXS": "173",
            "24PA-01655-COBKSS": "174",
            "24PA-01655-COBKMM": "175",
            "24PA-01655-COBKLL": "176",
            "24PA-01655-COBKXL": "177",
            "24PA-01655-COWHXS": "178",
            "24PA-01655-COWHSS": "179",
            "24PA-01655-COWHMM": "180",
            "24PA-01655-COWHLL": "181",
            "24PA-01655-COWHXL": "182",
            "24AP-01659-COBKXS": "183",
            "24AP-01659-COBKSS": "184",
            "24AP-01659-COBKMM": "185",
            "24AP-01659-COBKLL": "186",
            "24AP-01659-COLAXS": "187",
            "24AP-01659-COLASS": "188",
            "24AP-01659-COLAMM": "189",
            "24AP-01659-COLALL": "190",
            "24AP-01659-COWHXS": "191",
            "24AP-01659-COWHSS": "192",
            "24AP-01659-COWHMM": "193",
            "24AP-01659-COWHLL": "194",
            "24TO-01661-COBKXS": "195",
            "24TO-01661-COBKSS": "196",
            "24TO-01661-COBKMM": "197",
            "24TO-01661-COBKLL": "198",
            "24TO-01661-COBKXL": "199",
            "24TO-01661-COWHXS": "200",
            "24TO-01661-COWHSS": "201",
            "24TO-01661-COWHMM": "202",
            "24TO-01661-COWHLL": "203",
            "24TO-01661-COWHXL": "204",
            "24TO-01661-COMUXS": "205",
            "24TO-01661-COMUSS": "206",
            "24TO-01661-COMUMM": "207",
            "24TO-01661-COMULL": "208",
            "24TO-01661-COMUXL": "209",
            "24SH-01648-COBKXS": "210",
            "24SH-01648-COBKSS": "211",
            "24SH-01648-COBKMM": "212",
            "24SH-01648-COBKLL": "213",
            "24SH-01648-COBKXL": "214",
            "24SH-01648-COBKXX": "215",
            "24SH-01648-COWHXS": "216",
            "24SH-01648-COWHSS": "217",
            "24SH-01648-COWHMM": "218",
            "24SH-01648-COWHLL": "219",
            "24SH-01648-COWHXL": "220",
            "24SH-01648-COWHXX": "221",
            "24WO-01663-COHEXS": "222",
            "24WO-01663-COHESS": "223",
            "24WO-01663-COHEMM": "224",
            "24WO-01663-COHELL": "225",
            "24WO-01663-COHEXL": "226",
            "24WO-01663-COHEXX": "227",
            "24WO-01663-COSPXS": "228",
            "24WO-01663-COSPSS": "229",
            "24WO-01663-COSPMM": "230",
            "24WO-01663-COSPLL": "231",
            "24WO-01663-COSPXL": "232",
            "24WO-01663-COSPXX": "233",
            "24WO-01668-COLIXS": "234",
            "24WO-01668-COLISS": "235",
            "24WO-01668-COLIMM": "236",
            "24WO-01668-COLILL": "237",
            "24WO-01668-COSAXS": "238",
            "24WO-01668-COSASS": "239",
            "24WO-01668-COSAMM": "240",
            "24WO-01668-COSALL": "241",
            "24WO-01667-COLIXS": "242",
            "24WO-01667-COLISS": "243",
            "24WO-01667-COLIMM": "244",
            "24WO-01667-COLILL": "245",
            "24WO-01667-COLIXL": "246",
            "24WO-01667-COLIXX": "247",
            "24WO-01667-COSPXS": "248",
            "24WO-01667-COSPSS": "249",
            "24WO-01667-COSPMM": "250",
            "24WO-01667-COSPLL": "251",
            "24WO-01667-COSPXL": "252",
            "24WO-01667-COSPXX": "253",
            "24WO-01667-COSAXS": "254",
            "24WO-01667-COSASS": "255",
            "24WO-01667-COSAMM": "256",
            "24WO-01667-COSALL": "257",
            "24WO-01667-COSAXL": "258",
            "24WO-01667-COSAXX": "259",
            "24WO-01664-COHEXS": "260",
            "24WO-01664-COHESS": "261",
            "24WO-01664-COHEMM": "262",
            "24WO-01664-COHELL": "263",
            "24WO-01664-COHEXL": "264",
            "24WO-01664-COHEXX": "265",
            "24WO-01664-COSPXS": "266",
            "24WO-01664-COSPSS": "267",
            "24WO-01664-COSPMM": "268",
            "24WO-01664-COSPLL": "269",
            "24WO-01664-COSPXL": "270",
            "24WO-01664-COSPXX": "271",
            "24WO-01669-COHEXS": "272",
            "24WO-01669-COHESS": "273",
            "24WO-01669-COHEMM": "274",
            "24WO-01669-COHELL": "275",
            "24WO-01670-COHEXS": "276",
            "24WO-01670-COHESS": "277",
            "24WO-01670-COHEMM": "278",
            "24WO-01670-COHELL": "279",
            "24WO-01669-COSAXS": "280",
            "24WO-01669-COSASS": "281",
            "24WO-01669-COSAMM": "282",
            "24WO-01669-COSALL": "283",
            "24WO-01670-COSAXS": "284",
            "24WO-01670-COSASS": "285",
            "24WO-01670-COSAMM": "286",
            "24WO-01670-COSALL": "287",
            "24WO-01671-COSPXS": "288",
            "24WO-01671-COSPSS": "289",
            "24WO-01671-COSPMM": "290",
            "24WO-01671-COSPLL": "291",
            "24WO-01672-COSPXS": "292",
            "24WO-01672-COSPSS": "293",
            "24WO-01672-COSPMM": "294",
            "24WO-01672-COSPLL": "295",
            "24WO-01671-COSAXS": "296",
            "24WO-01671-COSASS": "297",
            "24WO-01671-COSAMM": "298",
            "24WO-01671-COSALL": "299",
            "24WO-01672-COSAXS": "300",
            "24WO-01672-COSASS": "301",
            "24WO-01672-COSAMM": "302",
            "24WO-01672-COSALL": "303",
            "24WO-01671-COLIXS": "304",
            "24WO-01671-COLISS": "305",
            "24WO-01671-COLIMM": "306",
            "24WO-01671-COLILL": "307",
            "24WO-01672-COLIXS": "308",
            "24WO-01672-COLISS": "309",
            "24WO-01672-COLIMM": "310",
            "24WO-01672-COLILL": "311",
            "24WO-01665-COHEXS": "312",
            "24WO-01665-COHESS": "313",
            "24WO-01665-COHEMM": "314",
            "24WO-01665-COHELL": "315",
            "24WO-01665-COHEXL": "316",
            "24WO-01665-COHEXX": "317",
            "24WO-01665-COSAXS": "318",
            "24WO-01665-COSASS": "319",
            "24WO-01665-COSAMM": "320",
            "24WO-01665-COSALL": "321",
            "24WO-01665-COSAXL": "322",
            "24WO-01665-COSAXX": "323",
            "24WO-01673-COSPSS": "324",
            "24WO-01673-COSPMM": "325",
            "24WO-01673-COSPLL": "326",
            "24WO-01673-COSPXL": "327",
            "24WO-01674-COSPSS": "328",
            "24WO-01674-COSPMM": "329",
            "24WO-01674-COSPLL": "330",
            "24WO-01674-COSPXL": "331",
            "24WO-01673-COSASS": "332",
            "24WO-01673-COSAMM": "333",
            "24WO-01673-COSALL": "334",
            "24WO-01673-COSAXL": "335",
            "24WO-01674-COSASS": "336",
            "24WO-01674-COSAMM": "337",
            "24WO-01674-COSALL": "338",
            "24WO-01674-COSAXL": "339",
            "24AP-01651-COBKUU": "340",
            "24AP-01651-COWHUU": "341",
            "24AP-01646-COWHUU": "342",
            "24AP-01646-COMUUU": "343",
            "24AP-01646-COBKUU": "344",
            "24AP-01644-COWHUU": "345",
            "24AP-01644-COLAUU": "346",
            "24AP-01644-COPEUU": "347",
            "24AP-01644-COBKUU": "348",
            "24AP-01662-COWHUU": "349",
            "24AP-01657-COWHUU": "350",
            "24AP-01657-COMUUU": "351",
            "24AP-01654-COWHUU": "352",
            "24TO-01660-COBKUU": "353",
            "24TO-01660-COWHUU": "354",
            "24AP-01630-COVEUU": "355",
            "24AP-01630-COVIUU": "356",
            "24AP-01630-COREUU": "357",
            "24WO-01666-COSAUU": "358",
            "24WO-01666-COLIUU": "359",
            "24WO-01675-COHEUU": "360",
            "24WO-01675-COLIUU": "361",
            "24WO-01675-COSPUU": "362",
            "24AP-01627-COVIUU": "363",
            "24AP-01626-COVEUU": "364",
            "24TO-01632-COVEUU": "365",
            "24SH-01633-COVEUU": "366",
            "24TO-01632-COALUU": "367",
            "24SH-01633-COALUU": "368",
            "24TO-01632-COREUU": "369",
            "24SH-01633-COREUU": "370",
            "24AP-01652-COMUUU": "371",
            "24AP-01652-COWHUU": "372",
            "24AP-01652-COBKUU": "373",
            "24AP-01653-COBKUU": "374",
            "24AP-01653-COLAUU": "375",
            "24AP-01653-COWHUU": "376",
            "24AP-01631-COSAXS": "377",
            "24AP-01631-COSASS": "378",
            "24AP-01631-COSAMM": "379",
            "24AP-01631-COSALL": "380",
            "24AP-01631-COSAXL": "381",
            "24AP-01631-COSAXX": "382",
            "24AP-01631-COALXS": "383",
            "24AP-01631-COALSS": "384",
            "24AP-01631-COALMM": "385",
            "24AP-01631-COALLL": "386",
            "24AP-01631-COALXL": "387",
            "24AP-01631-COALXX": "388",
            "24AP-01631-COCEXS": "389",
            "24AP-01631-COCESS": "390",
            "24AP-01631-COCEMM": "391",
            "24AP-01631-COCELL": "392",
            "24AP-01631-COCEXL": "393",
            "24AP-01631-COCEXX": "394",
            "24AP-01631-COVIXS": "395",
            "24AP-01631-COVISS": "396",
            "24AP-01631-COVIMM": "397",
            "24AP-01631-COVILL": "398",
            "24AP-01631-COVIXL": "399",
            "24AP-01631-COVIXX": "400",
            "24AP-01631-COREXS": "401",
            "24AP-01631-CORESS": "402",
            "24AP-01631-COREMM": "403",
            "24AP-01631-CORELL": "404",
            "24AP-01631-COREXL": "405",
            "24AP-01631-COREXX": "406"
        },
        "dateSubmitted": "2024-02-27T11:24:52.925Z"
    }
]

Welcome to the Make community!

Yes, that is possible. You’ll need a minimum of three modules:

Output:

Screenshot_2024-02-29_160222

Give it a go and let us know if you have any issues!

2 Likes

You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.

  1. Copy the code below by clicking the copy button when you mouseover the top-right of the code block
    Screenshot_2024-01-17_200117

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV to paste in the canvas.

  3. Click on each imported module and save it. You may need to remap some variables.

Modules JSON Export

{
    "subflows": [
        {
            "flow": [
                {
                    "id": 4,
                    "module": "builtin:BasicFeeder",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "array": "{{flatten(toArray(1.formResponse))}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 600,
                            "y": 0
                        },
                        "restore": {
                            "expect": {
                                "array": {
                                    "mode": "edit"
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "array",
                                "type": "array",
                                "label": "Array",
                                "mode": "edit",
                                "spec": []
                            }
                        ]
                    }
                },
                {
                    "id": 8,
                    "module": "util:TextAggregator",
                    "version": 1,
                    "parameters": {
                        "rowSeparator": "other",
                        "otherRowSeparator": ",",
                        "feeder": 4
                    },
                    "filter": {
                        "name": "is product",
                        "conditions": [
                            [
                                {
                                    "a": "{{4.key}}",
                                    "b": "\\w+-\\w+-\\w+",
                                    "o": "text:pattern:ci"
                                }
                            ]
                        ]
                    },
                    "mapper": {
                        "value": "{\n  \"SKU\": \"{{4.key}}\",\n  \"OrderQuantity\": {{4.value}}\n}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 900,
                            "y": 0
                        },
                        "restore": {
                            "parameters": {
                                "rowSeparator": {
                                    "label": "Other"
                                }
                            },
                            "extra": {
                                "feeder": {
                                    "label": "Iterator [4]"
                                }
                            },
                            "flags": {
                                "groupBy": {
                                    "collapsed": true
                                },
                                "stopIfEmpty": {
                                    "collapsed": true
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "rowSeparator",
                                "type": "select",
                                "label": "Row separator",
                                "validate": {
                                    "enum": [
                                        "\n",
                                        "\t",
                                        "other"
                                    ]
                                }
                            },
                            {
                                "name": "otherRowSeparator",
                                "type": "text",
                                "label": "Separator"
                            }
                        ],
                        "expect": [
                            {
                                "name": "value",
                                "type": "text",
                                "label": "Text"
                            }
                        ],
                        "advanced": true
                    }
                },
                {
                    "id": 10,
                    "module": "json:ParseJSON",
                    "version": 1,
                    "parameters": {
                        "type": ""
                    },
                    "mapper": {
                        "json": "{ \"LineItems\": [{{8.text}}]}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 1147,
                            "y": 2,
                            "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
    }
}
3 Likes

Brilliant, it works like a charm. Thank you for your assistance

2 Likes

No problem, glad I could help!

1. If you have a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

others can save time when catching up with the latest activity here, and

  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

1 Like