create_csv_table
Create a fully-typed table from a CSV in one call: infer column types by sampling rows, generate M declarations for every column, and refresh the table.
Instructions
Create a fully-typed import table from a (staged) CSV in ONE call: reads the header + samples rows to infer each column's type (Int64/Double/String), builds the Csv.Document M, declares EVERY column automatically, and refreshes. Removes the add_data_column-per-column grind. Pairs with stage_excel_to_csv / unpivot_weekly_csv. Pass pathExpression to control how the M references the file (e.g. 'DataFolder & "file.csv"'); omit to embed the absolute path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | new table name | |
| csvPath | Yes | absolute path to the CSV (read for header + type inference) | |
| sessionId | Yes | ||
| sampleRows | No | rows to sample for type inference (default 200) | |
| pathExpression | No | M File.Contents expression, e.g. DataFolder & "file.csv" (omit to embed the absolute path) |