M-Code Text.Contains Between two tables

@Melissa

I do have BufferTable,

The error that I get using:
Table.SelectRows(BufferReference, (IT) => Text.Contains([Description],IT[Description],Comparer.OrdinalIgnoreCase)){0}[Allocation]?, type text )

image


The code is returning the result, but if the allocation doesn’t exist in the lookup table then it returns an error.

I tried other two solutions that I thought might work:

Using “otherwise”

Table.SelectRows(BufferReference, (IT) => Text.Contains([Description],IT[Description],Comparer.OrdinalIgnoreCase)){0}[Allocation]? ,otherwise null, type text )

Then I thought I could wrap the function using “Table.ReplaceErrorValues” but again it didn’t work:

Table.ReplaceErrorValues(Table.SelectRows(BufferReference, (IT) => Text.Contains([Description],IT[Description],Comparer.OrdinalIgnoreCase)){0}[Allocation]? , type text ))

image