Power-Fx icon indicating copy to clipboard operation
Power-Fx copied to clipboard

New function to read Power Platform env vars

Open MikeStall opened this issue 1 year ago • 2 comments

See here: https://learn.microsoft.com/en-us/power-apps/maker/data-platform/environmentvariables

Key things there:

  1. Env vars have both display and logical name.
  2. Env vars vars have many types (like json):

Data Type. Select from Decimal number, Text, JSON, Two options, Data source, or Secret.

Given those requirements, looking at something like introducing each variable as a strongly typed constant like this:

Environment.Variable.VarName

  • VarName is the display name
  • it's scoped to the Variable object in the Environment namespace. The extra "Variable" layer helps avoid conflicts with other names on Environment.

MikeStall avatar May 20 '24 19:05 MikeStall

We may want this to be plural ".Variables" vs singular ".Variable". I need to check with the content team before we finalize.

gregli-msft avatar Jul 03 '24 14:07 gregli-msft

fyi - methods for converting between Display and Logical names: https://github.com/microsoft/Power-Fx/blob/c70286e724de26c535e2c44386d59340f9b8d6f6/src/libraries/Microsoft.PowerFx.Core/Public/Engine.cs#L498C23-L498C45

Persist in invariant form. Edit in display name.

MikeStall avatar Jul 03 '24 14:07 MikeStall