let ExtractionName = "ACDOCA", ServerUrl = "http://localhost:8065", // Record containing run parameters with corresponding values, can be empty // Usage: = // MUST NOT use "name" as a record field here Parameters = [ whereClause = "ACDOCA~GJAHR EQ '2025'"], Metadata = Json.Document( Web.Contents( ServerUrl, [ RelativePath = "config/extractions/" & ExtractionName & "/result-columns" ]) )[columns], Names = List.Transform(Metadata, each [name]), Types = List.Transform( Metadata, each { [name], if [type] = "Byte" then Byte.Type else if [type] = "Short" then Int16.Type else if [type] = "Int" then Int32.Type else if [type] = "Long" then Int64.Type else if [type] = "Decimal" then Decimal.Type else if [type] = "ByteArrayLengthExact" then Binary.Type else if [type] = "ByteArrayLengthUnknown" then Binary.Type else if [type] = "Double" then Double.Type else if [type] = "StringLengthMax" then Text.Type else if [type] = "StringLengthUnknown" then Text.Type else if [type] = "NumericString" then Text.Type else if [type] = "Date" then Date.Type else if [type] = "Time" then Time.Type else if [type] = "ConvertedTimeStampTicks" then DateTime.Type else Text.Type, [isPrimaryKey] }), QueryString = Uri.BuildQueryString( Record.Combine( { [ name= ExtractionName ], Parameters })), GetJson = Web.Contents( ServerUrl, [ Timeout = #duration(0, 1, 0, 0), RelativePath = "?" & QueryString ]), JsonDocument = Json.Document(GetJson), Data = Table.FromRows(JsonDocument), Result = Table.RenameColumns( Data, List.Zip({Table.ColumnNames(Data), Names}), MissingField.Error), TypedTable = Table.TransformColumnTypes( Result, Types, /* Empty string is the identifier for the invariant culture */ "") in Table.ReplaceKeys( TypedTable, { [ Columns = List.Transform( List.Select(Metadata, each [isPrimaryKey]), each [name]), Primary = true ] })