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 / Make Power Automate re...
Power Automate
Unanswered

Make Power Automate remember my previous variables even when the flow stops

(1) ShareShare
ReportReport
Posted on by 50

Hi community,

 

Many thanks for your help always.

I don't know if it is just me that has issue with this, but when a flow stops it forgets all its flow variables

so when I restart the flow I have to all start from the very beginning.

Is there a way to make RPA remember its previous flow variables?

 

I have the same question (0)
  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    If you are just trying to test your current flow, I recommend just adding the fixed variable temporarily into the place you want to “run from here”. 

    Otherwise, you could “save” the variables to environment variables. You would need to know where the breaks occur and pull these in through something similar to the following example:

     

    if %var1% isempty

        Get env Var %env_var1%
    end if

     

    Good luck!

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Power Automate Desktop does not have the possibility of storing variable values between flow runs. If you need to have those values available for your next run, you would need to store them somewhere. One possibility is the Windows environment variables like @MichaelAnnis suggested. Other options include some simple files (like a plain text file or CSV) that are easier to read than your normal input flow, a database, a SharePoint list or something like that.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • yiyi Profile Picture
    50 on at

    @MichaelAnnis @Agnius 

    Thank you for your sugguestion!

    Any downside of using windows environment variables.

    Can they be overwritten or cleared out when not needed?

  • yiyi Profile Picture
    50 on at

    @Agnius 

    If I choose to store it into some simple files, what action should I use?

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    If you choose to use environment variables, you simply “set environment variable” when you want to overwrite or “get environment variable” when you want to call it. 

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Environment variables can be set/cleared manually via the System Properties on Windows. I wouldn't really say there are any serious downsides, other than maybe some limitations to what you can store there.

    As to simple files, you could simply use Write text to file to write to a txt file or Write to CSV file if you want to store a data table, as storing it in CSV makes more sense.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • yiyi Profile Picture
    50 on at

    When setting the flow variable to environment variable, I cannot seem to use "for each...in..." with the new environment variable.

    Anyways to go around about it?

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    It's stored as a text string. Use Split text to split it into a list.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • jesse535 Profile Picture
    28 on at

    OK, but that is a lot of work if you have a dozen or so variables and suddenly your script crashes and you just want to fix the last line with the error. You have to go through a process that may take several minutes just to test one line and then repeat every time until you've debugged it. It would be much, much easier just to run from the line you want while keeping the data already stored.

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 796

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard