microsoft / Power-Fx

Power Fx low-code programming language
MIT License
3.18k stars 321 forks source link

New function to read Power Platform env vars #2416

Open MikeStall opened 4 months ago

MikeStall commented 4 months ago

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

gregli-msft commented 2 months ago

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

MikeStall commented 2 months ago

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.