Predefined Calculation: Whitespace PowerSuite - Next Collections Table

Summary

This formula will return an HTML table of next collection dates by service. It contains two columns: Service Name and Next Collection Date, which have configurable headings.

Inputs

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

Next Collections Table Inputs

  • the UPRN of the property to display data for

    The mapped value must come from an address lookup question, using the propery_identifier variable option.

  • the date format

    This input determines how dates are formatted in the Next Collection Date column, e.g. "d/m/Y".

  • the styling class

    A CSS class output on the table element in the HTML, to help with styling (only output on web and embedded form views. Internal forms inherit control centre table styling)

  • the Service column heading

    Allows configuration of the heading of the first column in the table.

  • the Next Collection Date heading

    Allows configuration of the heading of the second column in the table.

Return values

Value Description
An HTML table If there is one or more services found for the property with a valid next collection date
An empty string If there are no available dates, or an error occurred.

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 an empty string.

  2. A call to Whitespace PowerSuite's GetCollectionByUprnAndDate endpoint is made, passing the UPRN and the current date.

  3. A HTML table is built.

  4. The returned collections are iterated over. For each returned collection, we add its Service and Date properties as a row in the table if that Service has not already been added already.

  5. If the table contains any rows, its HTML is returned as the result of the calculation. If not, an empty string is returned.

results matching ""

    No results matching ""