microsoft / microsoft/Power-Fx

Data flow problem with Named Formulas

Open
#1,132 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.4k
Forks
358
Avg merge
10h 34m
Merged PRs (30d)
3

Description

To repro, use the following code in the REPL project to test:

_engine.UpdateVariable("CELL00", FormulaValue.New(0));
_engine.SetFormula("ROW0", expr: "[ CELL00 ]", onUpdate: null);
_engine.SetFormula("COLUMN0", expr: "[ CELL00 ]", onUpdate: null);
_engine.SetFormula("BOX00", expr: "[ CELL00 ]", onUpdate: null);
_engine.SetFormula("CELLSUM", expr: "Sum( CELL00, First(ROW0).Value, First(COLUMN0).Value, First(BOX00).Value )", onUpdate: null);

If you now increment CELL00, with:

Set(CELL00, 1)

You'll notice that CELLSUM is actually "2" instead of "4". But ROW0, COLUMN0 and BOX00 all have correct values.
If you keep increasing CELL00 you'll find the CELLSUM will lag behind the values of some of the named formulas.

Instead of Sum you can make a custom function to see it in more detail.

EDIT: this is not an issue in Power Apps, only in C# interpreter / RecalcEngine.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the REPL project and reproduce the named-formula example through the C# interpreter/RecalcEngine, then compare CELLSUM with ROW0, COLUMN0, and BOX00 after incrementing CELL00. Trace the update flow through UpdateVariable, SetFormula, and Set, including the Sum expression. Done means CELLSUM reflects all four current values instead of lagging behind.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.