Power Fx the low code macro language of the Power Platform is starting to become an omnipresent feature across the Power Platform family. The Nov 2022 Preview release of Power Virtual Agents includes the ability to use Power Fx in the authoring canvas. The addition of Power Fx greatly enhances the ability to add capabilities like data validation and manipulation directly in your bot rather than relying on Power Automate.
When you assign a value to a variable in authoring canvas you now have the option to select formula for its value. From the Formula tab you can enter your Power Fx expression. To access a variable you need to use its scope as a prefix. The scope options are
Global
System
Topic
In this example, I am using variables local to the Topic to calculate the interest due on a loan.
The ability to configure your Bots behavior when asking a question has also been extended. You are able to configure if the question should always be asked and how times it reprompts before failing.
You also configure additional validation as part of the question’s behavior. You can use a Power Fx expression to validate the question’s answer and also provide a custom message to the user if the validation has failed.
The ability to use Power Fx directly in your Power Virtual Agents bot looks like a great feature and I forwards to seeing how far it can be pushed.
Note: It looks like there is a bug in the preview release whereby the custom validation message only promotes for certain data types.