# nv.doForCompanies

This action allows you to apply the actions specified in its `then` parameter to each company provided by the parent action in Sales Navigator.

> There is a limit of 20 companies that this action can be applied to. If the parent action provides more than 20 companies, only the first 20 will be processed.

## Constraints

> ⏺️ **Root Start:** not allowed.

> ⬆️ **Parent Actions:** [nv.searchCompanies](/docs/action-nv-search-companies).

> ⬇️ **Child Actions:** [nv.openCompanyPage](/docs/action-nv-open-company-page).

## Parameters

```json
{
  "actionType": "nv.doForCompanies",
  "then": { ... }
}
```

- `then` – object or array of child actions to apply to each company from the parent action.

## Result options

This action doesn't produce its own distinct result. The effects are visible in the companies that were involved, as they will contain a `then` field with the results of the applied actions. See usage examples for more details.

## Usage examples

1. **Retrieving basic information about searched companies in Sales Navigator:**

**Workflow:**

```json
{
  "actionType": "nv.searchCompanies",
  "term": "Tech Inc",
  "filter": {
    "sizes": ["51-200", "2001-500"],
    "locations": ["San Francisco", "New York"],
    "industries": ["Software Development", "Robotics Engineering"],
    "annualRevenue": {
      "min": "0",
      "max": "2.5"
    }
  },
  "then": {
    "actionType": "nv.doForCompanies",
    "then": {
      "actionType": "nv.openCompanyPage",
      "basicInfo": true
    }
  }
}
```

**Completion:**

```json
{
  "actionType": "nv.searchCompanies",
  "success": true,
  "data": [
    {
      "name": "TechCorp",
      "hashedUrl": "https://www.linkedin.com/company/12345678",
      "industry": "Information Technology",
      "employeeCount": 500,
      "then": {
        "actionType": "nv.openCompanyPage",
        "success": true,
        "data": {
          "name": "TechCorp",
          "publicUrl": "https://www.linkedin.com/company/techcorp",
          "description": "TechCorp is a leading provider of innovative technology solutions for businesses worldwide.",
          "location": "Cupertino, California",
          "headquarters": "US",
          "industry": "Information Technology",
          "website": "https://techcorp.com",
          "employeeCount": 500,
          "yearFounded": 2019
        }
      }
    },
    {
      "name": "Techical Life",
      "hashedUrl": "https://www.linkedin.com/company/12345678",
      "industry": "Software Development",
      "employeeCount": 230,
      "then": {
        "actionType": "nv.openCompanyPage",
        "success": true,
        "data": {
          "name": "Techical Life",
          "publicUrl": "https://www.linkedin.com/company/techlife",
          "description": "TechLife is a worldwide leader in software development for sustainability.",
          "location": "Mountain View",
          "headquarters": "US",
          "industry": "Software Development",
          "website": "https://techlife.com",
          "employeeCount": 230,
          "yearFounded": 2016
        }
      }
    }
  ]
}
```

2. **Retrieving decision makers of searched companies in Sales Navigator:**

**Workflow:**

```json
{
  "actionType": "nv.searchCompanies",
  "term": "Tech Inc",
  "filter": {
    "sizes": ["51-200", "2001-500"],
    "locations": ["San Francisco", "New York", "London"],
    "industries": ["Software Development", "Robotics Engineering"],
    "annualRevenue": {
      "min": "0",
      "max": "2.5"
    }
  },
  "then": {
    "actionType": "nv.doForCompanies",
    "then": {
      "actionType": "nv.openCompanyPage",
      "then": {
        "actionType": "nv.retrieveCompanyDMs"
      }
    }
  }
}
```

**Completion:**

```json
{
  "actionType": "nv.searchCompanies",
  "success": true,
  "data": [
    {
      "name": "TechCorp",
      "hashedUrl": "https://www.linkedin.com/company/12345678",
      "industry": "Information Technology",
      "employeeCount": 500,
      "then": {
        "actionType": "nv.openCompanyPage",
        "success": true,
        "data": {
          "then": {
            "actionType": "nv.retrieveCompanyDMs",
            "success": true,
            "data": [
              {
                "name": "John Doe",
                "hashedUrl": "https://www.linkedin.com/in/SInQBmjJ015eLr8OeJoj0mrkxx7Jiuy0",
                "position": "Founder",
                "location": "New York, USA",
                "countryCode": "US"
              },
              {
                "name": "Jane Smith",
                "hashedUrl": "https://www.linkedin.com/in/ACoAA2DdsSV83B48UDvgO5jPoу3Gho0o",
                "position": "CEO",
                "location": "San Francisco, USA",
                "countryCode": "US"
              }
            ]
          }
        }
      }
    },
    {
      "name": "Techical Life",
      "hashedUrl": "https://www.linkedin.com/company/12345678",
      "industry": "Software Development",
      "employeeCount": 230,
      "then": {
        "actionType": "nv.openCompanyPage",
        "success": true,
        "data": {
          "then": {
            "actionType": "nv.retrieveCompanyDMs",
            "success": true,
            "data": [
              {
                "name": "Row Pitterson",
                "hashedUrl": "https://www.linkedin.com/in/S0mrkxx7JiuyInQBmjJ015eLr8OeJoj0",
                "position": "Founder",
                "location": "London, UK",
                "countryCode": "UK"
              },
              {
                "name": "Angela White",
                "hashedUrl": "https://www.linkedin.com/in/48UDvgO5jPoу3Gho0oACoAA2DdsSV83B",
                "position": "CEO",
                "location": "San Francisco, USA",
                "countryCode": "US"
              }
            ]
          }
        }
      }
    }
  ]
}
```
