microsoft / microsoft/Power-Fx

REPL: [pac pfx] Add Support for inserting records with Patch and Defaults

Open
#2,054 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Currently, if you use the following Power Fx with pac pfx:

Patch(Accounts,
    Defaults(Accounts),
    {
        'Account Name':"Test"
    }
);

It will fail with the error 'Defaults' is a recognized but not supported function.
This is not surprising since Defaults is not listed as a supported function at https://aka.ms/Power-Fx-PAC-CLI

If you omit the Defaults, then it gives the error Error 0-57: Invalid number of arguments: received 2, expected 3 or more.

The work around is to use Collect instead, however folks are mostly used to using Patch with Defaults as described by https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-patch#overview

Can support for Inserting records using Patch and Defaults be added?

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 with the pac pfx REPL entry point and reproduce the documented Patch with Defaults example from the issue. Trace how supported functions and Patch arguments are handled; done means the expression is accepted and inserts a record without the current unsupported-function or argument-count errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Feature
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.