The error is happening because the current query is included in #shared, and is being accessed as part of the [Value] = value filter. I'm not sure why the error doesn't happen when only Table.SelectRows is called. To avoid the error, try filtering out the current query by name before accessing [Value].
Fetching table's first row results in a "cyclic reference error"
Hello,
I have a simple function that takes a value and attempts to find its name (identifier) by looking it up in #shared.
let
Lookup = (value) =>
Table.SelectRows(Record.ToTable(#shared), each [Value] = value),
FoundEntry = Lookup(Text.AfterDelimiter) // the argument here is the function whose name we're trying to find
in
// FindEntry // works fine
// Table.FirstValue(FoundEntry) // raises 'Expression.Error: A cyclic reference was encountered during evaluation.' - why?
FoundEntry{0} // raises 'Expression.Error: A cyclic reference was encountered during evaluation.' - why?
Using the input value to filter #shared (converted to a table) down to the corresponding row works fine. However, attempting to select the first row (FoundEntry{0}) or first value (Table.FirstRow(FoundEntry) from this table results in an "Expression.Error: A cyclic reference was encountered during evaluation" being raised.
This seems strange, as limiting the output returned to just the first row or first value doesn't seem to introduce anything obviously cyclic.
Any idea what's going on here?
Thanks,
Ben
Community Center | Not monitored
-
Ehren (MSFT) 1,781 Reputation points Microsoft Employee
2021-07-22T18:01:04.477+00:00