Table.HasColumns

This function checks if the specified columns are present in the table. It will return true if the column(s) are found, and false if they are not.

Syntax

Table.HasColumns(table as table, columns as any) as logical

About

This function checks if the specified columns are present in the table. It will return true if the column(s) are found, and false if they are not.

Explanation

To determine whether a table contains the specified column [Name], the following Power Query M function can be used: Table.HasColumns(Table.FromRecords({...}), "Name"). The output will be either true or false, indicating the presence of the column. Similarly, to find if a table has both columns [Name] and [PhoneNumber], the function Table.HasColumns(Table.FromRecords({...}), {"Name", "PhoneNumber"}) can be utilized. The resulting output will be true if both columns are present, otherwise false.