Forum Discussion
rpiboy_1
2 years agoHelper V
OLE OBDC error: help interpreting auto generated error query
I was getting the following error: failed to save modifications to the server. error returned 'ole db or odbc error: [Expression.Error] We cannot convert the value null to type Function After...
rpiboy_1
2 years agoHelper V
Not sure it helps or not, but here is the M-Code for the query that is failing to load. Not terribly complex. For each server there is a function that is called. The function takes an arguement for the data type to query from the REST endpoint.
let
//join the server code query with the project data type query
#"Added Custom" = Table.AddColumn(lst_ServerCodes, "ProjectAdminDataType", each lst_ProjectDataTypes),
//expand the data types column to create a cross-join
#"Expanded ProjectAdminDataType" = Table.ExpandTableColumn(#"Added Custom", "ProjectAdminDataType", {"ProjDataTypes"}, {"ProjDataTypes"}),
// change the type on the new column
#"Changed Type" = Table.TransformColumnTypes(#"Expanded ProjectAdminDataType",{{"ProjDataTypes", type text}}),
//execute custom function to iterate through each server and data type to get data
#"ExecuteFunction" = Table.AddColumn(
#"Changed Type",
"AdminData",
each Function.Invoke(
Expression.Evaluate(
"FnAdminQuery"&[ServerCodes],
#shared
),
{[ProjDataTypes]}
)
)
in
ExecuteFunction- rpiboy_12 years agoHelper V
I've done some further testing where I removed the iterative process and directly called one function with one arguement and the results of that query loads, so there seems to be something that power query does not like about iterating through an determining which function to apply, then applying it For Each possible arguement value.