Find deals with a product
The Find deals with a product robot finds the Bitrix24 (Alaio) deals whose products include a given product, filtered by contact, company and open deals, and returns their IDs, the count and the ID of the newest one.
The robot searches deals by a catalog product. A workflow has no stock way to learn which deals sell a particular product: the deal list filter by products is not available to robots. The robot takes a product ID and, optionally, a contact ID, a company ID and an "open deals only" flag (not in a final stage), scans the matching deals from newest to oldest and returns the IDs of those that have the product among their products, their count and the ID of the newest one. The number of deals returned is limited by a setting (50 by default) and the scan by the newest 500 deals matching the filter, so the robot does not overload the account. When there are no deals the count is zero and the process can take another branch.
What input parameters does the robot accept?
| Parameter | Type | Required? | Default |
|---|---|---|---|
| Product ID | int | yes | |
| Contact ID (optional) | string | — | |
| Company ID (optional) | string | — | |
| Open deals only | bool | — | N |
| How many deals to return (50 by default; the newest 500 deals matching the filter are scanned) | int | — | 50 |
What does the robot return?
| Parameter | Type |
|---|---|
| Found deal IDs | int |
| Number of deals found | int |
| ID of the first (newest) deal | int |
| Success | bool |
| Error | string |
What errors can the robot return?
The robot writes these messages to the business process log when it cannot complete a step. The text tells you what to fix in the settings or the data.
- Enter the product ID.
- API error while searching deals.
Scenario: warn managers about a product recall
- The process is started manually with the product ID
- The robot returns the IDs of open deals that contain this product
- A loop over the list sets a task for the responsible person of each deal