Skip to main content

Notifications

Community site session details
Power Automate - Using Flows
Answered

Environment variable not updating with current value

Like (2) ShareShare
ReportReport
Posted on 7 May 2021 13:54:24 by

Hi,

 

Within an unmanaged solution I'm trying to update my environment variable from its default to its current value but it does not seem to be working consistently.

 

I have two flows in my dev environment which are reading the default value properly. I then export this as an unmanaged solution into prod (I don't export as managed for the reasons explained in another post of mine). In prod, I update the environment variable with a current value. I believe the first time this happened, the variables were updated well. However, I went back to dev to make some modifications and re-imported it into prod. In prod, both the default and current value still appears. However, when I ran my flows, they were still grabbing the default value and ignore the current value.

 

In order to hopefully make the platform realize that I want the current value, I tried a dumb trick of cutting the current value and re-pasting it exactly back into the current value field. This causes the Save button to become enabled, letting me click on it and resulting in the spinner saying 'Updating variable'. Then I ran my two flows again and the first one now seems to be grabbing the current value. However, the second one is still reading the default value.

 

In other words, it seems that even if a solution already contains a current value, if you re-import it, it is actually going to grab the default. You need to re-save for the prod environment to see the current value. However, this only seems to work for one of the flows in this solution, but not the other.

 

Either I'm not doing something right or there is a bug here.

 

Thanks

  • spieflow Profile Picture
    4 on 16 Sep 2022 at 21:24:55
    Re: Environment variable not updating with current value

    I am having the same issue and I will am going to read the value directly from Dataverse instead of using the variable in Flow. Hopefully Microsoft will fix this soon.

  • PaulCoote Profile Picture
    2 on 20 Jul 2022 at 18:33:11
    Re: Environment variable not updating with current value

    I ran into exact same issue it seems inconsistent when the flow reads the current value. One flow does and one doesn't.

    To work around this instead of referring to the environment variable directly via parameters(variable) I am reading the record from the Dataverse Environment variable values table, with the action Dataverse List rows, this works fine but I am sure will generate issues with packaged solutions.

  • maxpower45255 Profile Picture
    223 on 21 Jun 2022 at 12:57:43
    Re: Environment variable not updating with current value

    @Anonymous I got a notification for your update that started with "<rant>Coming from a Win32/COM background I'm always astounded ...". But when I clicked on it, I only see your last comment with "Agreed". I'm not sure if you edited your comment or if it was somehow deleted/sensored? But I agree with what you said. The documentation is still very light and doesn't go into too much details. 

    I personally think that the low-code/no-code and citizen-developer is just marketing. You still have to learn how to program, deal with loops, data structures, write scripts, etc. To do basic flows like notify a user when an email hits an inbox or a file is saved on a share is quite easy and any "citizen-developer" can do it. But to write complex programs that have to handle database reads/writes, call Restful services, and do complex parsing isn't for everyone. 

    in any case, I hope some MSFT support person will comment and explain how these environment variables are handled.    

  • Community Power Platform Member Profile Picture
    on 21 Jun 2022 at 02:20:06
    Re: Environment variable not updating with current value

    Agreed

  • maxpower45255 Profile Picture
    223 on 22 Jan 2022 at 02:33:33
    Re: Environment variable not updating with current value

    I exported an unmanaged solution from dev and made sure the values were deleted before export. When I imported it into QA, it never asked me for new values. Moreover, I deleted the values from the current environment for each of the environment variables I exported (in QA). I saved new values. Yet, the flows in QA were still reading the values from dev. The only solution that worked is what @Tristan_Reeves suggested (Thanks @Tristan_Reeves ). I had to manually turn off and then on each of my flows. 

    This should be remedied by the Power Platform team. It doesn't make sense that you have to consult documentation and read some fine print to "save" values. The "Save" button should handle the clearing of any current values and really do what "Save" is meant to do. It's frustrating to have to rely on a totally different function such as "Turn off/On" to save new environment variable values. Poor design IMO.  

    I hope that someone from MSFT is listening and hope that this thread helps anyone who's having this issue.   

  • Community Power Platform Member Profile Picture
    on 10 May 2021 at 16:19:54
    Re: Environment variable not updating with current value

    Wow ok, I've read that page a few times now but I didn't put the two and two together. Well, sounds like MS is aware of this and also I guess resaving is the real solution. Thanks!

  • Verified answer
    Tristan_Reeves Profile Picture
    17 on 10 May 2021 at 15:25:00
    Re: Environment variable not updating with current value

    Confirmed I have the exact same issue. According to microsoft importing or turning off/on the flow should update the environmental variable, but it does not. Only editing and resaving works for me.

    Tristan_Reeves_0-1620660261421.png

    https://docs.microsoft.com/en-us/powerapps/maker/data-platform/environmentvariables

     

     

  • Community Power Platform Member Profile Picture
    on 10 May 2021 at 07:16:01
    Re: Environment variable not updating with current value

    Tinkering a little more I think I'm seeing that the problem is not having to re-save the current values for the environment variables. The issue may actually be that you need to re-save the flows using them. Does this sound normal to anyone?

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow