PADData Operationsjsondatatableapi

DataTable → JSON Array

Converts a PAD DataTable to a JSON array string suitable for API POST bodies, SharePoint multi-value columns, or inter-flow variable passing. PAD has no native DataTable-to-JSON action — this pattern uses PowerShell to do the conversion reliably with correct type handling.

Members OnlySign in or create a free account to view and copy this pattern.

Usage Notes

  • The DataTable is first written to a temp CSV, then PowerShell converts it to JSON — this is the only reliable method in PAD.
  • ConvertTo-Json -Depth 5 handles nested objects; increase depth if your data has deeper nesting.
  • Numbers and booleans in the CSV are treated as strings by Import-Csv — add type-casting in the PowerShell if needed.
  • The output varJsonArray is a string — pass it directly as an API request body or store in a SharePoint text column.
  • Clean up the temp CSV after use to avoid stale data on re-runs.

Requirements

  • Power Automate Desktop 2.30+
  • Variables: varSourceData (DataTable), varJsonArray (Text)
  • Write access to C:\\PAD\\Temp\\ (or adjust the temp path)
DataTable → JSON Array | FlowLibs