Predefined Calculation: Bartec Collective - Garden Bins at Property

Summary

This formula will build a HTML table of all garden bins currently at a particular property.

Setup

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

The formula requires the following settings to be configured under Settings > Integrations > Bartec Collective > Settings.

Garden Feature Name Match

The value entered into the setting must partially match the description of the organic features as configured in Bartec Collective.

For example if in Bartec Collective your features are named as:

  • GARDEN 160L
  • GARDEN 240L
  • GARDEN 550L

You would enter GARDEN into the setting as the value as that will match all organic features.

Inputs

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

  • the UPRN of the property to check.

    This should be mapped to the property identifier element of an address lookup question.

  • a styling class

    This is a CSS class which will be applied to the <table> tag in the output. Use this to apply specific styling to the output.

Return values

Value Description
A HTML table of all garden bins This will contain three columns: name of bin, size of bin, and the quantity.
false If there are no garden bins at the property, or an error occurred.

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 false.

  2. The formula calls Features_Types_Get.

  3. The returned records are filtered, to find only features where the name matches the Garden Feature Name Match setting. If no types are returned, the formula returns false.

  4. The formula then calls Features_Schedules_Get passing the UPRN and the list of garden bin types obtained in step 2. If no schedules are returned, the formula returns false.

  5. The returned schedules are filtered down to only active ones i.e. where the schedules 'From' attribute is in the past, and 'To' is in the future. If there are no active schedules, the formula returns false.

  6. Any schedule with a unique feature ID is added to the list of bins to be shown in the table, unless its feature status is 'PLANNED'.

  7. If the list of bins to be shown in the table is empty, the formula returns false.

  8. The table markup is built from the list of bins created in step 5, and returned as the result of the formula.

results matching ""

    No results matching ""