MC903533 Error while saving "Current Value" in Environment Variables UX pane in PowerApps portal
Primary service: Power Platform
ChangePilot summary
- Users may encounter errors when saving environment variable values due to a known issue in the processing.
- Two scenarios are outlined for resolution: using API calls or Power Automate, and through the Maker Portal.
- Necessary actions include updating existing EnvironmentVariableValue records instead of creating new ones.
- Microsoft is working on a fix that will be included in an upcoming platform update.
- Users are encouraged to reach out to Microsoft Support for further assistance if needed.
History
Recorded changes
No changes recorded since ChangePilot first saw this post.
Microsoft message
Our monitoring has detected that you may have encountered an error when trying to save an environment variable value.
Sample error messages:
What actions do I need to take?
Please take the following steps, depending on your scenario, to resolve this issue:
Scenario 1: Custom code using API calls or Power Automate
Sample error messages:
- Cannot complete the creation of EnvironmentVariableValue because it violates a database constraint. The violation happens on the key environmentvariabledefinitionid: {GUID}. Please delete the existing record or use update.
It is invalid to create component EnvironmentVariableValue with the same export key value(s) as an existing component. Please change the key. The current value(s) are environmentvariabledefinitionid: {GUID}.
What actions do I need to take?
Please take the following steps, depending on your scenario, to resolve this issue:
Scenario 1: Custom code using API calls or Power Automate
- Query the EnvironmentVariableValue that is associated with the EnvironmentVariableDefinition that you're trying to manipulate. Using its environmentvariablevalueid execute an Update operation instead of the Create operation.
- For example: if you have a flow or custom code that always performs the Create operation, it must now use the update operation to change an existing environment variable value.
- API Documentation: Update and delete table rows using the Web API (Microsoft Dataverse) - Power Apps
- Flow Documentation: Use a flow to update a row in Dataverse - Power Automate
- Take note of the Environmentvariabledefinitionid in the error message.
- Find the existing EnvironmentVariableValue value by typing this URL in the browser and replacing <Environmentvariabledefinitionid> with the value from the error message:
- API documentation: Retrieve a table row using the Web API - Power Apps | Microsoft Learn
- Notate the value for environmentvariablevalueid in the response.
- Delete the EnvironmentVariableValue record using Postman or a similar web client tool by performing a DELETE operation on the following URL, replacing the with the value from the previous step:
- API documentation: Update and delete table rows using the Web API (Microsoft Dataverse) - Power Apps
- {org-url}/api/data/v9.2/environmentvariablevalues?$select= environmentvariablevalueid& $filter=_environmentvariabledefinitionid_value eq
- DETELE {org-url}/api/data/v9.2/environmentvariablevalues()