cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jsalaz1989
Advocate III
Advocate III

Environment variable not updating with current value

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

 

 

View solution in original post

8 REPLIES 8
Jsalaz1989
Advocate III
Advocate III

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?

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

 

 

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!

maxpower45255
Advocate II
Advocate II

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.   

Agreed

maxpower45255
Advocate II
Advocate II

@GoAwaysadsadsad 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.    

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.

spieflow
Regular Visitor

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.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,323)