Skip to main content

Bartec Collective - Chosen Booking is Available

  • What is it? This formula will verify that a chosen date for a Bulky or Scrap Metal Collection is still available to be booked.

Setup

The formula requires integration with Bartec Collective to be configured. This can be done under Settings > Integrations > Bartec Collective.

Specifically the formula relies upon the settings:

  • Bulky Collections Name Match
  • Maximum Bulky Waste Collections Per Work Pack
  • Maximum Scrap Metal Collections Per Work Pack

Inputs

This formula requires 2 inputs to be passed through to it:

  • the Booking Work Pack

    This should be mapped to the workpack ID obtained from the "Bartec Collective - Date Selector" component

  • the Booking Type

    Choose between Bulky and Scrap Metal.

Return values

ValueDescription
YesIf the specified workpack still has capacity
NoIf there is no capacity, or there is an error contacting Bartec Collective

Note: return values are case sensitive

Formula Logic

  1. A check is made to see if the integration has been enabled in the Settings > Integrations page. If the integration is not enabled the formula returns No.

  2. If Booking Type is Bulky a call is made to Workpacks_Metrics_Get, passing the Workpack ID.

    The workpack actions are iterated and jobs matching the name set in the setting Bulky Collections Name Match are counted.

  3. If Booking Type is Scrap Metal a call is made to Jobs_Get, passing in the Workpack ID.

    The jobs returned are iterated and the jobs matching the name set in the the setting Bulky Collections Name Match are counted.

  4. The number of jobs returned are then compared against the settings

    • Maximum Bulky Waste Collections Per Work Pack when Booking Type is Bulky

    • Maximum Scrap Metal Collections Per Work Pack when Booking Type is Scrap Metal

    If the number of jobs is less than the maximum Yes is returned, otherwise No is returned.