cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
etherjack
Level: Powered On

Initialize variable mid-flow

If I decide I need a new variable halfway through my flow and add the 'Initialize Variable' action, I get a message saying that I can only initialize a variable at the beginning of the flow. That makes sense as it's what I would normally do when writing custom code in C# and PowerShell.

But, based on many of the screenshots I see in posts (on this forum and others), it appears that variables can be initialzed pretty much at any point. Is that the case? Was this perhaps possible is earlier releases but is not any longer?

 

For example: Here's one being initialized as the 3rd step

 

11

1 REPLY 1
Super User
Super User

Re: Initialize variable mid-flow

You can initialize variables only as long as the actions are not nested in apply to each and scopes.

 

You can use Set variables however. So it is a good idea to initialize varibales at the beginning (without setting a value) and then set values later in the flows. 

 

In some situations you may also be able to use the compose actions instead.

 

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 306 members 1,714 guests
Please welcome our newest community members: