{
    "name": "Remove duplicate records from Airtable database with ChatGPT",
    "flow": [
        {
            "id": 1,
            "module": "airtable:ActionSearchRecords",
            "version": 3,
            "parameters": {},
            "mapper": {
                "base": "appzLVKxD6IOAdHMr",
                "table": "tblazMkZJG8gEujp8",
                "fields": [
                    "Asset Type",
                    "Type",
                    "Article",
                    "Link",
                    "Solutions"
                ],
                "useColumnId": false
            },
            "metadata": {
                "designer": {
                    "x": 0,
                    "y": 0
                },
                "restore": {
                    "expect": {
                        "base": {
                            "mode": "chose",
                            "label": "Use Cases"
                        },
                        "sort": {
                            "mode": "chose"
                        },
                        "view": {
                            "mode": "chose"
                        },
                        "table": {
                            "mode": "chose",
                            "label": "Solutions Assets"
                        },
                        "fields": {
                            "mode": "chose",
                            "label": [
                                "Asset Type",
                                "Type",
                                "Article",
                                "Link",
                                "Solutions"
                            ]
                        },
                        "maxRecords": {
                            "empty": true
                        },
                        "useColumnId": {
                            "mode": "chose"
                        }
                    },
                    "parameters": {
                        "__IMTCONN__": {
                            "data": {
                                "scoped": "true",
                                "connection": "airtable2"
                            },
                            "label": "Wayne"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTCONN__",
                        "type": "account:airtable3,airtable2",
                        "label": "Connection"
                    }
                ],
                "expect": [
                    {
                        "name": "base",
                        "type": "select",
                        "label": "Base",
                        "required": true
                    },
                    {
                        "name": "useColumnId",
                        "type": "boolean",
                        "label": "Use Column ID",
                        "required": true
                    },
                    {
                        "name": "table",
                        "type": "select",
                        "label": "Table",
                        "required": true
                    },
                    {
                        "name": "formula",
                        "type": "text",
                        "label": "Formula"
                    },
                    {
                        "name": "maxRecords",
                        "type": "integer",
                        "label": "Limit"
                    },
                    {
                        "name": "sort",
                        "spec": [
                            {
                                "name": "field",
                                "type": "select",
                                "label": "Field",
                                "dynamic": true,
                                "options": []
                            },
                            {
                                "name": "direction",
                                "type": "select",
                                "label": "Direction",
                                "options": [
                                    {
                                        "label": "Descending",
                                        "value": "desc"
                                    },
                                    {
                                        "label": "Ascending",
                                        "value": "asc"
                                    }
                                ]
                            }
                        ],
                        "type": "array",
                        "label": "Sort"
                    },
                    {
                        "name": "view",
                        "type": "select",
                        "label": "View"
                    },
                    {
                        "name": "fields",
                        "type": "select",
                        "label": "Output Fields",
                        "multiple": true
                    }
                ],
                "interface": [
                    {
                        "name": "__IMTLENGTH__",
                        "type": "uinteger",
                        "label": "Total number of bundles"
                    },
                    {
                        "name": "__IMTINDEX__",
                        "type": "uinteger",
                        "label": "Bundle order position"
                    },
                    {
                        "name": "id",
                        "type": "text",
                        "label": "ID"
                    },
                    {
                        "name": "createdTime",
                        "type": "date",
                        "label": "Created Time"
                    },
                    {
                        "name": "Asset Type",
                        "type": "text",
                        "label": "Asset Type"
                    },
                    {
                        "name": "Type",
                        "type": "text",
                        "label": "Type"
                    },
                    {
                        "name": "Article",
                        "spec": {
                            "label": "Record ID"
                        },
                        "type": "array",
                        "label": "Article"
                    },
                    {
                        "name": "Link",
                        "type": "text",
                        "label": "Link"
                    },
                    {
                        "name": "Solutions",
                        "spec": {
                            "label": "Record ID"
                        },
                        "type": "array",
                        "label": "Solutions"
                    }
                ]
            }
        },
        {
            "id": 5,
            "module": "util:TextAggregator",
            "version": 1,
            "parameters": {
                "feeder": 1,
                "rowSeparator": "n"
            },
            "mapper": {},
            "metadata": {
                "designer": {
                    "x": 300,
                    "y": 0
                },
                "restore": {
                    "extra": {
                        "feeder": {
                            "label": "Airtable - Search Records"
                        }
                    },
                    "parameters": {
                        "rowSeparator": {
                            "label": "New row"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "rowSeparator",
                        "type": "select",
                        "label": "Row separator",
                        "validate": {
                            "enum": [
                                "n",
                                "t",
                                "other"
                            ]
                        }
                    }
                ],
                "expect": [
                    {
                        "name": "value",
                        "type": "text",
                        "label": "Text"
                    }
                ],
                "advanced": true
            }
        },
        {
            "id": 6,
            "module": "openai-gpt-3:CreateCompletion",
            "version": 1,
            "parameters": {},
            "mapper": {
                "model": "gpt-4-0613",
                "select": "chat",
                "messages": [
                    {
                        "role": "user",
                        "content": "Please analyse the following links to check if a link is duplicated: {{5.text}}nnIf a link is duplicated, output the link as many times as it is duplicated links as a JSON, for example 3 of the same link. nnDo not output any other text besides the JSON itself with the all the duplicated links and remove any numbers after ':' like '2'. nnDo not provide any pre-text like 'After analyzing all the provided links, I found the one link that is a duplicate:', only the JSON is required.nnWhen parsed, it must be outputed as an array and name it 'Duplicates'.n"
                    }
                ]
            },
            "metadata": {
                "designer": {
                    "x": 600,
                    "y": 0
                },
                "restore": {
                    "expect": {
                        "echo": {
                            "mode": "chose"
                        },
                        "model": {
                            "mode": "chose",
                            "label": "gpt-4-0613"
                        },
                        "select": {
                            "label": "Create a Chat Completion (GPT Models)"
                        },
                        "messages": {
                            "mode": "chose",
                            "items": [
                                {
                                    "role": {
                                        "mode": "chose",
                                        "label": "User"
                                    }
                                }
                            ]
                        },
                        "additionalParameters": {
                            "mode": "chose"
                        }
                    },
                    "parameters": {
                        "__IMTCONN__": {
                            "data": {
                                "scoped": "true",
                                "connection": "openai-gpt-3"
                            },
                            "label": "Make Ent GPT4"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTCONN__",
                        "type": "account:openai-gpt-3",
                        "label": "Connection"
                    }
                ],
                "expect": [
                    {
                        "name": "select",
                        "type": "select",
                        "label": "Select Method",
                        "required": true,
                        "validate": {
                            "enum": [
                                "chat",
                                "prompt"
                            ]
                        }
                    },
                    {
                        "name": "max_tokens",
                        "type": "number",
                        "label": "Max Tokens"
                    },
                    {
                        "name": "temperature",
                        "type": "number",
                        "label": "Temperature",
                        "validate": {
                            "max": 2,
                            "min": 0
                        }
                    },
                    {
                        "name": "top_p",
                        "type": "number",
                        "label": "Top P",
                        "validate": {
                            "max": 1,
                            "min": 0
                        }
                    },
                    {
                        "name": "n_completions",
                        "type": "number",
                        "label": "Number"
                    },
                    {
                        "name": "echo",
                        "type": "boolean",
                        "label": "Echo"
                    },
                    {
                        "name": "additionalParameters",
                        "spec": [
                            {
                                "name": "key",
                                "type": "text",
                                "label": "Parameter Name",
                                "required": true
                            },
                            {
                                "name": "type",
                                "type": "select",
                                "label": "Input Type",
                                "options": [
                                    {
                                        "label": "Text",
                                        "value": "text",
                                        "nested": [
                                            {
                                                "name": "value",
                                                "type": "text",
                                                "label": "Parameter Value"
                                            }
                                        ],
                                        "default": true
                                    },
                                    {
                                        "label": "Number",
                                        "value": "number",
                                        "nested": [
                                            {
                                                "name": "value",
                                                "type": "number",
                                                "label": "Parameter Value"
                                            }
                                        ]
                                    },
                                    {
                                        "label": "Boolean",
                                        "value": "boolean",
                                        "nested": [
                                            {
                                                "name": "value",
                                                "type": "boolean",
                                                "label": "Parameter Value"
                                            }
                                        ]
                                    },
                                    {
                                        "label": "Date",
                                        "value": "date",
                                        "nested": [
                                            {
                                                "name": "value",
                                                "type": "date",
                                                "label": "Parameter Value"
                                            }
                                        ]
                                    },
                                    {
                                        "label": "Any",
                                        "value": "any",
                                        "nested": [
                                            {
                                                "name": "value",
                                                "type": "any",
                                                "label": "Parameter Value"
                                            }
                                        ]
                                    }
                                ]
                            }
                        ],
                        "type": "array",
                        "label": "Other Input Parameters"
                    },
                    {
                        "name": "model",
                        "type": "select",
                        "label": "Model",
                        "required": true
                    },
                    {
                        "name": "messages",
                        "spec": [
                            {
                                "name": "role",
                                "type": "select",
                                "label": "Role",
                                "options": [
                                    {
                                        "label": "System",
                                        "value": "system"
                                    },
                                    {
                                        "label": "User",
                                        "value": "user"
                                    },
                                    {
                                        "label": "Assistant",
                                        "value": "assistant"
                                    }
                                ],
                                "required": true
                            },
                            {
                                "name": "content",
                                "type": "text",
                                "label": "Message Content"
                            }
                        ],
                        "type": "array",
                        "label": "Messages",
                        "required": true
                    }
                ]
            }
        },
        {
            "id": 7,
            "module": "json:ParseJSON",
            "version": 1,
            "parameters": {},
            "filter": {
                "name": "Duplicates found",
                "conditions": [
                    [
                        {
                            "a": "{{6.choices[].message.content}}",
                            "b": "No duplicates found.",
                            "o": "text:notcontain:ci"
                        }
                    ],
                    [
                        {
                            "a": "{{6.choices[].message.content}}",
                            "b": "No duplicates found",
                            "o": "text:notcontain:ci"
                        }
                    ]
                ]
            },
            "mapper": {
                "json": "{{6.choices[].message.content}}"
            },
            "metadata": {
                "designer": {
                    "x": 900,
                    "y": 0
                },
                "restore": {},
                "parameters": [
                    {
                        "name": "type",
                        "type": "udt",
                        "label": "Data structure"
                    }
                ],
                "expect": [
                    {
                        "name": "json",
                        "type": "text",
                        "label": "JSON string",
                        "required": true
                    }
                ]
            },
            "onerror": [
                {
                    "id": 16,
                    "module": "builtin:Ignore",
                    "version": 1,
                    "metadata": {
                        "designer": {
                            "x": 1090,
                            "y": 245
                        }
                    }
                }
            ]
        },
        {
            "id": 15,
            "module": "builtin:BasicFeeder",
            "version": 1,
            "parameters": {},
            "mapper": {
                "array": "{{7.Duplicates}}"
            },
            "metadata": {
                "designer": {
                    "x": 1200,
                    "y": 0
                },
                "restore": {
                    "expect": {
                        "array": {
                            "mode": "edit"
                        }
                    }
                },
                "expect": [
                    {
                        "mode": "edit",
                        "name": "array",
                        "spec": [],
                        "type": "array",
                        "label": "Array"
                    }
                ]
            }
        },
        {
            "id": 12,
            "module": "airtable:ActionSearchRecords",
            "version": 3,
            "parameters": {},
            "mapper": {
                "base": "appzLVKxD6IOAdHMr",
                "table": "tblazMkZJG8gEujp8",
                "fields": [
                    "Asset Type",
                    "Type",
                    "Article",
                    "Link",
                    "Solutions"
                ],
                "formula": "Link = '{{15.value}}'",
                "maxRecords": "100",
                "useColumnId": false
            },
            "metadata": {
                "designer": {
                    "x": 1500,
                    "y": 0
                },
                "restore": {
                    "expect": {
                        "base": {
                            "mode": "chose",
                            "label": "Use Cases"
                        },
                        "sort": {
                            "mode": "chose"
                        },
                        "view": {
                            "mode": "chose"
                        },
                        "table": {
                            "mode": "chose",
                            "label": "Solutions Assets"
                        },
                        "fields": {
                            "mode": "chose",
                            "label": [
                                "Asset Type",
                                "Type",
                                "Article",
                                "Link",
                                "Solutions"
                            ]
                        },
                        "useColumnId": {
                            "mode": "chose"
                        }
                    },
                    "parameters": {
                        "__IMTCONN__": {
                            "data": {
                                "scoped": "true",
                                "connection": "airtable2"
                            },
                            "label": "Wayne"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTCONN__",
                        "type": "account:airtable3,airtable2",
                        "label": "Connection"
                    }
                ],
                "expect": [
                    {
                        "name": "base",
                        "type": "select",
                        "label": "Base",
                        "required": true
                    },
                    {
                        "name": "useColumnId",
                        "type": "boolean",
                        "label": "Use Column ID",
                        "required": true
                    },
                    {
                        "name": "table",
                        "type": "select",
                        "label": "Table",
                        "required": true
                    },
                    {
                        "name": "formula",
                        "type": "text",
                        "label": "Formula"
                    },
                    {
                        "name": "maxRecords",
                        "type": "integer",
                        "label": "Limit"
                    },
                    {
                        "name": "sort",
                        "spec": [
                            {
                                "name": "field",
                                "type": "select",
                                "label": "Field",
                                "dynamic": true,
                                "options": []
                            },
                            {
                                "name": "direction",
                                "type": "select",
                                "label": "Direction",
                                "options": [
                                    {
                                        "label": "Descending",
                                        "value": "desc"
                                    },
                                    {
                                        "label": "Ascending",
                                        "value": "asc"
                                    }
                                ]
                            }
                        ],
                        "type": "array",
                        "label": "Sort"
                    },
                    {
                        "name": "view",
                        "type": "select",
                        "label": "View"
                    },
                    {
                        "name": "fields",
                        "type": "select",
                        "label": "Output Fields",
                        "multiple": true
                    }
                ],
                "interface": [
                    {
                        "name": "__IMTLENGTH__",
                        "type": "uinteger",
                        "label": "Total number of bundles"
                    },
                    {
                        "name": "__IMTINDEX__",
                        "type": "uinteger",
                        "label": "Bundle order position"
                    },
                    {
                        "name": "id",
                        "type": "text",
                        "label": "ID"
                    },
                    {
                        "name": "createdTime",
                        "type": "date",
                        "label": "Created Time"
                    },
                    {
                        "name": "Asset Type",
                        "type": "text",
                        "label": "Asset Type"
                    },
                    {
                        "name": "Type",
                        "type": "text",
                        "label": "Type"
                    },
                    {
                        "name": "Article",
                        "spec": {
                            "label": "Record ID"
                        },
                        "type": "array",
                        "label": "Article"
                    },
                    {
                        "name": "Link",
                        "type": "text",
                        "label": "Link"
                    },
                    {
                        "name": "Solutions",
                        "spec": {
                            "label": "Record ID"
                        },
                        "type": "array",
                        "label": "Solutions"
                    }
                ],
                "advanced": true
            }
        },
        {
            "id": 8,
            "module": "airtable:ActionDeleteRecord",
            "version": 3,
            "parameters": {},
            "filter": {
                "name": "Second position",
                "conditions": [
                    [
                        {
                            "a": "{{12.`__IMTINDEX__`}}",
                            "b": "2",
                            "o": "number:equal"
                        }
                    ]
                ]
            },
            "mapper": {
                "id": "{{12.id}}",
                "base": "appzLVKxD6IOAdHMr",
                "table": "tblazMkZJG8gEujp8"
            },
            "metadata": {
                "designer": {
                    "x": 1800,
                    "y": 0
                },
                "restore": {
                    "expect": {
                        "base": {
                            "mode": "chose",
                            "label": "Use Cases"
                        },
                        "table": {
                            "mode": "chose",
                            "label": "Solutions Assets"
                        }
                    },
                    "parameters": {
                        "__IMTCONN__": {
                            "data": {
                                "scoped": "true",
                                "connection": "airtable2"
                            },
                            "label": "Wayne"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTCONN__",
                        "type": "account:airtable3,airtable2",
                        "label": "Connection"
                    }
                ],
                "expect": [
                    {
                        "name": "base",
                        "type": "select",
                        "label": "Base",
                        "required": true
                    },
                    {
                        "name": "table",
                        "type": "select",
                        "label": "Table",
                        "required": true
                    },
                    {
                        "name": "id",
                        "type": "text",
                        "label": "Record ID",
                        "required": true
                    }
                ]
            }
        }
    ],
    "metadata": {
        "instant": false,
        "version": 1,
        "scenario": {
            "roundtrips": 1,
            "maxErrors": 3,
            "autoCommit": true,
            "autoCommitTriggerLast": true,
            "sequential": false,
            "slots": null,
            "confidential": false,
            "dataloss": false,
            "dlq": false,
            "freshVariables": false
        },
        "designer": {
            "orphans": []
        },
        "zone": "eu2.make.com",
        "notes": [
            {
                "moduleIds": [
                    15
                ],
                "content": "<p>You will notice that the Iterator has two data items: Duplicated_ Please execute the scenario twice. </p>",
                "isFilterNote": false,
                "metadata": {
                    "color": "#9138FE"
                }
            }
        ]
    }
}