New function to read Power Platform env vars
See here: https://learn.microsoft.com/en-us/power-apps/maker/data-platform/environmentvariables
Key things there:
- Env vars have both display and logical name.
- 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.
We may want this to be plural ".Variables" vs singular ".Variable". I need to check with the content team before we finalize.
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.