Summary Functions

The following summary tables (getForms_Summary, getLocations_Summary, getResources_Summary) will provide details for each form, location or resource with a RecordCount, how many records of those are passed (compliant) and the pass percentage. The Resources_Summary table will also include the ResourceType (TypeName).

The values will be determined by the date range provided using the following parameters:

  • Date Type (Required)
  • Time Zone Offset (Required)
  • Start Date (Conditional)*
  • End Date (Conditional)*
  • Minutes Ago (Conditional)*
  • Form Name (Optional)
  • Form Query Type (Optional)

πŸ“˜

Note:

*Start Date + End Date or Minutes Ago must be provided to build the date range query. All other optional values a null value can be provided; see examples below.

For more detail on the parameters see the full list of descriptions here.

function (dateType as text, timeZone as number, startDate as datetime, endDate as datetime, MinAgo as number, formName as text, formQueryType as text)

Invoking the Functions

All Summary Functions (getForms_Summary, getLocations_Summary, getResources_Summary) utilize the same parameters. Here is an example of invoking them using Power Query or through the visual editor.

With Date Range:

getForms_Summary("Processed", 0, #datetime(2023, 6, 21, 0, 0, 0), #datetime(2023, 6, 22, 0, 0, 0), null, null, null)
getLocations_Summary("Processed", 0, #datetime(2023, 6, 21, 0, 0, 0), #datetime(2023, 6, 22, 0, 0, 0), null, null, null)
getResources_Summary("Processed", 0, #datetime(2023, 6, 21, 0, 0, 0), #datetime(2023, 6, 22, 0, 0, 0), null, null, null)

With Min Ago:

 getForms_Summary("Modified", 0, null, null, 1440, null, null)
 getLocations_Summary("Modified", 0, null, null, 1440, null, null)
 getResources_Summary("Modified", 0, null, null, 1440, null, null)

πŸ“˜

Note:

You can fill out the function parameters and click _Invoke _to create the table automatically. See example below.

getForms_Summary Result:

The following field columns will be outputted in a table.

#table(
  {
    "formName",
    "recordCount",
    "passCount",
    "passPercent",
    "row"
  }, {})

getLocations_Summary Result:

The following field columns will be outputted in a table.

#table(
  {
    "locationName",
    "recordCount",
    "passCount",
    "passPercent",
    "row"
  }, {})

getResources_Summary Result:

The following field columns will be outputted in a table.

#table(
  {
    "resourceName",
    "resourceType",
    "recordCount",
    "passCount",
    "passPercent",
    "row"
  }, {})

πŸ‘

Tip:

Once the table is created, remember to rename (Right-click the table and click Rename) and format your columns. You can set recordCount, passCount, and _passPercent _as numbers; see Power Query example below.

 Table.TransformColumnTypes(Source,{{"recordCount", Int64.Type}, {"passCount", Int64.Type}, {"passPercent", Int64.Type}})