microsoft / microsoft/Power-Fx

Collect error message has wrong number of args

Open
#1,360 2 comments 0 reactions 1 assignee View on GitHub

@anderson-joyle is already working on this.

Since Apr 13, 2023.

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

Description

Reprod with:
Collect(Tasks,{Subject:"test",Owner:First(Users)})

On this line in CollectFunctions
errors.EnsureError(DocumentErrorSeverity.Severe, args[0], TexlStrings.ErrNeedValidVariableName_Arg, Name);

https://github.com/microsoft/Power-Fx/blob/f5ef31b5d61e45ee25cbc314477638bfb964747b/src/libraries/Microsoft.PowerFx.Interpreter/Functions/Mutation/CollectFunction.cs#L186

message
"The first argument of '{0}' should be a valid variable name, and cannot conflict with any existing control, screen, collection, or data source names. Found type '{1}'"
args
{object[1]}
[0]: "Collect"

PowerApps fails with a good error:
image

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.