{
  "name": "Oregon CCB contractor licenses to Google Sheets",
  "flow": [
    {
      "id": 2,
      "module": "apify:runActorNew",
      "version": 1,
      "parameters": {
        "__IMTCONN__": "REPLACE_APIFY_CONNECTION"
      },
      "mapper": {
        "actor_search_type": "store",
        "actorId": "loomwise~oregon-contractor-licenses",
        "runSync": true,
        "timeout": 300,
        "memory": 1024,
        "inputBodyloomwiseoregon-contractor-licenses": "{\n  \"registeredWithinDays\": 30,\n  \"counties\": [\n    \"MULTNOMAH\",\n    \"WASHINGTON\",\n    \"CLACKAMAS\"\n  ],\n  \"maxResults\": 100,\n  \"includeContactDetails\": true,\n  \"includeInsuranceBond\": true\n}"
      },
      "metadata": {
        "designer": {
          "x": 0,
          "y": 0
        },
        "restore": {
          "expect": {
            "actorId": {
              "mode": "chose",
              "label": "loomwise/oregon-contractor-licenses"
            }
          }
        },
        "parameters": [
          {
            "name": "__IMTCONN__",
            "type": "account:apify2,apify",
            "label": "Connection",
            "required": true
          }
        ],
        "expect": [
          {
            "name": "actor_search_type",
            "type": "select",
            "label": "Search Actors from",
            "required": true,
            "validate": {
              "enum": [
                "user",
                "store"
              ]
            }
          },
          {
            "name": "runSync",
            "type": "boolean",
            "label": "Run synchronously",
            "required": true
          },
          {
            "name": "actorId",
            "type": "select",
            "label": "Actor",
            "required": true
          },
          {
            "name": "inputBodyloomwiseoregon-contractor-licenses",
            "type": "text",
            "label": "Input JSON"
          }
        ]
      }
    },
    {
      "id": 3,
      "module": "apify:fetchDatasetItems",
      "version": 1,
      "parameters": {
        "__IMTCONN__": "REPLACE_APIFY_CONNECTION"
      },
      "mapper": {
        "datasetId": "{{2.defaultDatasetId}}",
        "type": "clean",
        "format": "json",
        "limit": "1000",
        "offset": "0"
      },
      "metadata": {
        "designer": {
          "x": 300,
          "y": 0
        },
        "restore": {
          "expect": {
            "type": {
              "mode": "chose",
              "label": "Clean"
            },
            "format": {
              "mode": "chose",
              "label": "JSON"
            }
          }
        },
        "parameters": [
          {
            "name": "__IMTCONN__",
            "type": "account:apify2,apify",
            "label": "Connection",
            "required": true
          }
        ],
        "expect": [
          {
            "name": "datasetId",
            "type": "text",
            "label": "Dataset ID",
            "required": true
          },
          {
            "name": "type",
            "type": "select",
            "label": "Data transformation",
            "required": true,
            "validate": {
              "enum": [
                "clean",
                "simplified",
                "none"
              ]
            }
          },
          {
            "name": "format",
            "type": "select",
            "label": "Format",
            "required": true,
            "validate": {
              "enum": [
                "json",
                "csv",
                "html",
                "xml",
                "rss",
                "xlsx"
              ]
            }
          },
          {
            "name": "limit",
            "type": "uinteger",
            "label": "Limit",
            "validate": {
              "max": 100000,
              "min": 1
            }
          },
          {
            "name": "offset",
            "type": "uinteger",
            "label": "Offset",
            "validate": {
              "min": 0
            }
          },
          {
            "name": "fields",
            "type": "text",
            "label": "Fields"
          },
          {
            "name": "omit",
            "type": "text",
            "label": "Omit Fields"
          }
        ]
      }
    },
    {
      "id": 4,
      "module": "google-sheets:addRow",
      "version": 2,
      "parameters": {
        "__IMTCONN__": "REPLACE_GOOGLE_CONNECTION"
      },
      "mapper": {
        "spreadsheetId": "REPLACE_WITH_YOUR_GOOGLE_SHEET_ID",
        "sheetId": "Sheet1",
        "values": {
          "businessName": "{{3.businessName}}",
          "licenseNumber": "{{3.licenseNumber}}",
          "licenseTypeName": "{{3.licenseTypeName}}",
          "registeredDate": "{{3.registeredDate}}",
          "county": "{{3.county}}",
          "city": "{{3.city}}",
          "businessPhone": "{{3.businessPhone}}",
          "businessAddress": "{{3.businessAddress}}",
          "bondCompany": "{{3.bondCompany}}",
          "insuranceCompany": "{{3.insuranceCompany}}",
          "insuranceExpirationDate": "{{3.insuranceExpirationDate}}"
        },
        "includesHeaders": true
      },
      "metadata": {
        "designer": {
          "x": 600,
          "y": 0
        },
        "parameters": [
          {
            "name": "__IMTCONN__",
            "type": "account:google",
            "label": "Connection",
            "required": true
          }
        ]
      }
    }
  ],
  "metadata": {
    "instant": false,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": false,
      "confidential": false,
      "dataloss": false,
      "dlq": false
    },
    "designer": {
      "orphans": []
    },
    "notes": [
      "Import via Make \u2192 \u22ef \u2192 Import Blueprint. Reconnect Apify + Google accounts (placeholders will not work).",
      "Scheduling is NOT in this blueprint. After import, open the scenario clock and set the schedule noted in the companion .md file.",
      "Module 3 is apify:fetchDatasetItems (current Get Dataset Items). Map Dataset ID from {{2.defaultDatasetId}} on Run an Actor.",
      "For the public templates library: recreate as a Team Template \u2192 Publish \u2192 Request approval."
    ]
  }
}
