GetVoidedRecords


📘

Note

Query performance depends on the volume of data retrieved within the selected time frame. Using Submitted Date Types and narrower date ranges can improve performance, but may exclude relevant data. Choose your date range carefully to balance speed and completeness.

Summary

The GetVoidedRecords function retrieves voided record-level data based on the parameters provided. Each row in the result set represents a single record.

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)
  • Location Name (Optional)
  • Resource Name (Optional)
  • Request Identifier (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 (TableType as text, FormName as text, FormQueryType as text, DateType as text, TimeZone as number, StartDate as datetime, EndDate as datetime, MinAgo as number, Location as text, Resource as text, RequestIdentifier as text)

Invoking the Function

Here is an example of invoking them using Power Query or through the visual editor.

With Date Range:

GetVoidedRecords("Submitted", 0, #datetime(2023, 6, 21, 0, 0, 0), #datetime(2023, 6, 22, 0, 0, 0), null, null, null)
GetVoidedRecords("Modified", 0, #datetime(2023, 6, 21, 0, 0, 0), #datetime(2023, 6, 22, 0, 0, 0), null, "HC-Test Form", "FormName")
GetVoidedRecords("Processed", 0, #datetime(2023, 6, 21, 0, 0, 0), #datetime(2023, 6, 22, 0, 0, 0), null, "HC-Test", "FormLike")

With Min Ago:

 GetVoidedRecords("Submitted", 0, null, null, 1440, null, null)
 GetVoidedRecords("Modified", 0, null, null, 1440, "HC-Test Form", "FormName")
 GetVoidedRecords("Processed", 0, null, null, 1440, "HC-Test", "FormLike")
📘

Note:

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

GetVoidedRecords Results



RecordNumberRecordComplianceSubmittedDateLocationNameFormNameFormVersionResourceNameResourceTypeResourceIdSubmittedUserNameIsSignedIsCompleteCommentSubmittedTimeZoneProcessedDateRecordIdModifiedDateModifiedUserNameVerificationListImageListRow
1513TRUE2020-03-18T22:48:00Los Angeles, CA00 Keyboard Block Issue7.0OMF Flite Bars, Wear Pads and BoltsEquipmenta84630f0-5211-45dc-8d03-7be08d97e32ekstanwyckFALSEFALSEAmerica/Los_Angeles2020-03-18T22:48:476896e2f1-ebb6-4a13-8292-75dc3d7f93012020-03-18T22:48:47kstanwycknullnull1
1519FALSE2020-03-23T17:38:39Los Angeles, CASugar Log Example1.0Cane Sugar - CoarseItemse002a49d-8e0b-4eb0-bdbe-226e1145ddbeNMartinezFALSEFALSEUS/Central2020-03-23T17:38:397e42a7a4-6f7b-4dc5-80c2-b48d93c4fabf2020-03-23T17:38:39NMartineznullnull2
1570TRUE2020-04-14T15:23:50Green Bay, WIQC Finished Product Check Test4.0Resource1Items48ae31b4-d54c-4f96-9aea-fd54dfd86d5aNMartinezTRUEFALSEUS/Central2020-04-14T15:23:504af7202c-305b-494b-b425-9e0b3316b7cc2020-04-14T15:23:50NMartinez[List]null3
1654FALSE2020-06-02T05:18:36Green Bay, WI00 SPC TEST6.0Item13Itemsd62fc614-363d-48cf-a3a0-67090bed6638SuperAdminFALSEFALSEEtc/GMT2020-06-02T05:18:36fd10e2f2-7567-4a7d-a9bb-146ba338d61c2020-06-02T05:18:36SuperAdminnullnull4
1660TRUE2020-06-04T13:09:36Green Bay, WIaaa4.0Salterd SWEETEquipment3c4f7d3d-58d8-4ffe-aa44-11580fb12434NMartinezFALSEFALSEEtc/GMT2020-06-04T13:10:4620493cc4-efd8-4b42-a566-83b907e601132020-06-04T13:10:46NMartineznullnull5

The following field columns will be outputted in a table.

#table({
  "RecordNumber",
  "RecordCompliance",
  "SubmittedDate",
  "LocationName",
  "FormName",
  "FormVersion",
  "ResourceName",
  "ResourceType",
  "ResourceId",
  "SubmittedUserName",
  "IsSigned",
  "IsComplete",
  "Comment",
  "SubmittedTimeZone",
  "ProcessedDate",
  "RecordId",
  "ModifiedDate",
  "ModifiedUserName",
  "VerificationList",
  "ImageList",
  "Row"
}, {})

Formatting Column Data Types


👍

Tip:

Once the table is created, you may format the columns as needed. Select Transform-> Detect Data Type.

For example, you may choose to set ProcessedDate, ModifiedDate, and SubmittedDate as datetime fields (see the Power Query example below).


Table.TransformColumnTypes(Source,{{"RecordNumber", Int64.Type},{"SubmittedDate", type datetime},{"ModifiedDate", type datetime},{"ProcessedDate", type datetime}})