Using Power Apps for Teams Power FX Formula Columns in Dataverse

Jared Johnson, 05 May 2022

Formula table columns are currently in preview, but Microsoft docs state that they are only available in Power Apps for Teams for now.

Now while the Maker experience is only available in Power Apps for Teams, can we create them there and bring them into our normal Dataverse environment?

To test this, I created a simple table in Power Apps for Teams, creating a Total column using a Formula column.

Then I added this Table to a solution and exported it and imported it into a Dataverse environment (if you are in Power Apps for Teams within teams you will not see Solutions, but you can click the Open in Power Apps button which will open make.powerapps.com. You could also use the Export feature instead to export the table).

And Success!

So, they currently work in Dataverse, but how do they work under the hood?
Looking at the Customisations.xml file for the Total field, there is an element called FormulaDefinitionFileName which is pointing to a yaml file. The current Calculated fields also use this element, but they instead use .xaml files.

<attribute PhysicalName="cr32d_Total">

<Type>decimal</Type>

<Name>cr32d_total</Name>

<LogicalName>cr32d_total</LogicalName>

...

<FormulaDefinitionFileName>/Formulas/cr32d_icecreamorders-FormulaDefinitions.yaml</FormulaDefinitionFileName>

</attribute>

Looking at the yaml file in the Formulas folder it contains the formula almost exactly as we wrote it just using field names instead, and it that it is bundling all the formulas for a table into one file unlike the current Calculated fields which is per Column (and is also a big xml file even for something simple like this).

Unsurprisingly trying to edit the formula in Dataverse results in an error.

Formula Columns are part of the 2022 Wave 1 update where hopefully they are fully integrated into the Dataverse maker experience.