Skip to content

Update EnvironmentVariableValue in Power Fx

Posted in Power Platform, and Dynamics 365

In my private project (Key Box), I stored a JSON configuration in an Environment Variable. The configuration is displayed in a custom page and can be edited there. Here is how to update an EnvironmentVariableValue in Power Fx.

To update a Dataverse record, you need a reference to it. In my case, I already retrieved it as record in the step before, stored as global variable “envVarValRec” and I just reuse it now.

Update EnvironmentVariableValue in Power Fx

Patch(
   'Environment Variable Values'; // the table name
   envVarValRec; // the record to update
   Defaults('Environment Variable Values');
   {
      Value: "payload" // the string to store
   }
)

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.