'set Power Query display folder for a query column in M?

I have a number of very wide datasets in Power Query - hundreds of columns each (don't ask). I am trying to determine if (how) to assign columns to display folders programatically. I have access to some data that I could use to assign the display folder based on the column name. Some research into the metadata functions in M is tantalizing but I have not found the silver bullet example yet. Has anyone attempted this?

I've done some basic research and written some bits of M to look at the metadata functions, but that's about it. I was hoping someone might have the magic function call needed to set the display folder, or know if it is even possible.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source