Predefined Calculation: Bartec Collective - Check Service Requests
Summary
This formula will determine if a property already has an existing service request matching a particular status, bin type and request type.
Setup
The formula requires integration with Bartec Collective to be configured. This can be done under Settings > Integrations > Bartec Collective.
Inputs
This formula requires 4 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.
the bin type to check against
the service request type to check against
This is used only to populate the options for the status input.
the status to check against
Return values
Value | Description |
---|---|
Yes | If the property specified has a matching service request of the specified status, request type and bin type |
No | If not |
error | If an error occurred querying Collective |
Note: return values are case sensitive
Formula Logic
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 error.
The formula calls ServiceRequests_Get, passing the UPRN and status.
For each record returned, the ServiceCode parameter is passed to ServiceRequests_Detail_Get.
If this is returned successfully, the extended data fields from it are processed, to find one with a Name of 'FeatureType'.
The value of the 'FeatureType' extended data field is compared to the specified bin type in a case-insensitive manner. If they match, the result of the formula is Yes.
If no returned service request record has a matching feature type, the formula result is No.