Power Fx Functions are a great addition to Dataverse and allow you to build plugin-like functionality without code, but they’re not without their quirks.

Consider the following Power Fx function setup:
An example Power Fx function
Seems straightforward enough? Take Input1 and Input2, multiple them together and return the result as a property called Value. No errors in the editor and it saves ok.

However, if you try and call this function you will get this error:

Environment.freeze_TestFunction failed: {“error”:{“code”:”0x80040265″,”message”:”Plugin Test Function failed with: Unsupported param type: Integer. Fx type InMemoryRecordValue”}} 

Accompanying the error is a link that goes to a Microsoft page that doesn’t mention the error above once.

So what’s the problem and the fix?

There are certain system words that are used within Power Fx – some are function names and some are out-of-the-box objects – and Value is one of those. So although the editor will happily let you create the above formula without complaint, when it runs, the logic confuses the parameter with the system word ‘Value’ and that’s what leads to the error. Chances are, other words could also trigger this issue – and the editor won’t currently prevent you using them as parameter names.

The fix? Change Value to something else.