Update EnvironmentVariableValue in Power Fx

Benjamain JohnDyn365CE1 year ago21 Views

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
   }
)

Original Post https://benjaminjohn.de/update-environmentvariablevalue-in-power-fx

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Join Us
  • X Network2.1K
  • LinkedIn3.8k
  • Bluesky0.5K
Support The Site
Events
March 2025
MTWTFSS
      1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31       
« Feb   Apr »
Follow
Sign In/Sign Up Sidebar Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...