Skip to content

Add support for Dataverse custom PowerFx functions#295

Merged
mkholt merged 4 commits intomasterfrom
feature/dataverse-powerfx-functions
Oct 13, 2025
Merged

Add support for Dataverse custom PowerFx functions#295
mkholt merged 4 commits intomasterfrom
feature/dataverse-powerfx-functions

Conversation

@mkholt
Copy link
Member

@mkholt mkholt commented Oct 13, 2025

Add support for in the PowerFx parser for:

  • IsUTCToday
  • ISOWeekNum
  • UTCNow
  • UTCToday

Also added tests for all other functions supported by Dataverse, as mentioned in the documentation: https://learn.microsoft.com/en-us/power-platform/power-fx/formula-reference-formula-columns

@mkholt mkholt requested a review from Copilot October 13, 2025 11:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for custom PowerFx functions specific to Dataverse, implementing UTCToday, UTCNow, IsUTCToday, and ISOWeekNum functions. It also includes comprehensive test coverage for these new functions along with existing supported PowerFx functions.

Key changes:

  • Implemented four custom PowerFx functions for date/time operations with UTC timezone support
  • Added TimeSpan offset parameter to the FormulaFieldEvaluator for testing flexibility
  • Refactored test infrastructure to use a service factory pattern for better abstraction

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/XrmMockup365Test/UnitTestBase.cs Refactored to extract service wrapper and add organization service factory pattern
tests/XrmMockup365Test/TestFormulaFields.cs Added comprehensive test coverage for PowerFx functions including new Dataverse-specific functions
src/XrmMockup365/FormulaFieldEvaluator.cs Enhanced to support custom functions and time offset for testing
src/XrmMockup365/CustomFunction/UTCTodayFunction.cs Implements UTCToday custom function
src/XrmMockup365/CustomFunction/UTCNowFunction.cs Implements UTCNow custom function
src/XrmMockup365/CustomFunction/IsUTCTodayFunction.cs Implements IsUTCToday custom function
src/XrmMockup365/CustomFunction/ISOWeekNumFunction.cs Implements ISOWeekNum custom function with .NET Framework compatibility
src/XrmMockup365/Core.cs Updated to pass time offset to formula evaluator

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mkholt mkholt merged commit 4090bf3 into master Oct 13, 2025
2 of 3 checks passed
@mkholt mkholt deleted the feature/dataverse-powerfx-functions branch October 13, 2025 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants