web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Remove environment var...
Power Automate
Answered

Remove environment variables from flow, solution and environment

(1) ShareShare
ReportReport
Posted on by 85
I have a flow in a solution with some environment variables like SharePoint site url and list name. I removed this environment variable from the flow and make it hardcoded because my target environment is not allowing dataverse from a DLP policy. I removed the environment variable also from the environment. When I try to turn on the flow I got this error:

Turn on failed. Failed to find environment variables with schema name(s) 'myCompany_SharePoint_Herstelplannen, myCompany_Lijst_Aannemers, myCompany_Inhoudstype_Inbehandeling, myCompany_Inhoudstype_Uitvoerenopdracht'. Create environment variables with those names or use different environment variables.
 
I exported the solution and check my flow xml, and searched for the environment variable names. I see them in the definition -> parameters section. It looks like the flow is still having a reference to the environment variables while it is not using it anymore. How can I remove these environment variable reference from the flow? This is a flow with the classic designer.
 
"definition": {
      "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {
        "$connections": {
          "defaultValue": {},
          "type": "Object"
        },
        "$authentication": {
          "defaultValue": {},
          "type": "SecureObject"
        },
        "SharePoint_Herstelplannen (myCompany_SharePoint_Herstelplannen)": {
          "defaultValue": "https://myCompany.sharepoint.com/teams/Herstelplannen",
          "type": "String",
          "metadata": {
            "schemaName": "myCompany_SharePoint_Herstelplannen"
          }
        },
        "Lijst_Aannemers (myCompany_Lijst_Aannemers)": {
          "defaultValue": "239cffab-42a6-4071-8f38-db5b4fc97d72",
          "type": "String",
          "metadata": {
            "schemaName": "myCompany_Lijst_Aannemers"
          }
        },
        "Inhoudstype_Inbehandeling (myCompany_Inhoudstype_Inbehandeling)": {
          "defaultValue": "0x0100EAAED366DB0D944A9A6B125E6FF2B5F60030EF27C20E16F545B72165C686076D6D",
          "type": "String",
          "metadata": {
            "schemaName": "myCompany_Inhoudstype_Inbehandeling"
          }
        },
        "Inhoudstype_Uitvoerenopdracht (myCompany_Inhoudstype_Uitvoerenopdracht)": {
          "defaultValue": "0x01000845E561AB893446A36120C9E1232BF300446CC96DF20B96468B58C4228E9215E2",
          "type": "String",
          "metadata": {
            "schemaName": "myCompany_Inhoudstype_Uitvoerenopdracht"
          }
        }
      }
 
Categories:
I have the same question (0)
  • Vish WR Profile Picture
    3,306 on at
     
    What’s actually happening (accurate version)
     
    In solution-aware flows (classic designer):
     
    Environment variables are not just in definition. parameters
    They are also referenced in:
    connectionReferences
    definition. parameters → metadata.schemaName
    solution component dependency layer (Dataverse)
     
    So even if you:
     
    remove them from actions
    delete them from parameters
     
    Power Automate can STILL detect dependency → and block activation
     
    Option 1 (Clean rebuild — actually works)
     
    Create a brand new flow (do NOT copy existing)
    Build it manually from scratch
    Add actions fresh (especially SharePoint connectors)
    Enter hardcoded values directly
    Ensure:
    No dynamic content from environment variables
    Save → Turn ON
    Then delete the old flow from the solution
     
    Option 2 Edit Solution Package (advance)
     
    Export Solution as Unmanaged
    Unzip
    Open /Workflows/<flowname>.json
    Locate "parameters": {
    Delete ALL environment variable blocks, e.g.:
    "SharePoint_Herstelplannen (myCompany_SharePoint_Herstelplannen)": { ... }
    Keep only:
    "$connections"
    "$authentication"
    Save → zip → re-import solution (overwrite)
     
  • Suggested answer
    11manish Profile Picture
    2,387 on at
    Your issue occurs because:
    • Environment variable references still exist in the flow’s definition parameters
    Best solution:
    • Recreate the flow (clean and safest)
    Alternative:
    • Recreate environment variables temporarily to unblock
  • Verified answer
    Valantis Profile Picture
    5,364 on at
     
    The classic designer does not give you a way to remove orphaned entries from the parameters section of the flow definition through the UI. Even when you remove all usages of an environment variable from the flow actions, the parameter entry stays in the definition and the flow still registers a dependency on it at turn-on time.
    The confirmed fix is to edit the solution zip directly:
    1. Export the solution as unmanaged
    2. Open the zip and find the flow definition JSON file under the Workflows folder
    3. In the definition > parameters section, remove all four environment variable entries (the ones with the schemaName metadata)
    4. Keep only the $connections and $authentication entries
    5. Also check the solution's customizations.xml or the environment variable definition files in the solution and remove any dependency references pointing to those schema names
    6. Re-zip the solution and import it back
    7. Try turning on the flow
    One thing to double check before editing search the entire flow JSON not just the parameters section for any of the four schema names. If any action is still referencing them via a @parameters() expression, that also needs to be replaced with the hardcoded value.
    Also worth knowing: the Microsoft docs confirm that when you remove an environment variable reference in the designer, the recommended approach is to remove it and re-add it rather than just editing the field. The UI does not always clean up the parameters section automatically.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 784

#2
Valantis Profile Picture

Valantis 589

#3
Haque Profile Picture

Haque 522

Last 30 days Overall leaderboard