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

Variables in parallel branches

Hello fellow Flow makers !

 

Context :

I have a pretty big flow used to copy some pages from a Company site to several (23 and up) Branches sites.

The branches sites are referenced in a list stored in the Company site's content. It contains the URL of the site, the Title (more user-friendly) and a multi-valued managed-metadata column.

 

For each item found in the BranchSites list, it will copy the original page to the SitePages library, search for the managed metadata column's hidden internal name in the library, then it will copy the page and edit some metadatas (as the multivalued managed metadata column and the PromotedState) using sometimes HTTP requests using REST. The copy action is the standard one from SharePoint

But this action is a bit too slow : 29min for 23 copies.copy_flow_01.PNG

 

copy_flow_02.PNG

 

 

As you can see, this is a straight flow, and each copy can not be launch if the previous one's steps are not fulfilled.

So, when my customer told me that he wanted to prioritize the branches (for example, the Group page is published in Western Europe. The USA are nearly awoken at that time, but the Chinese are not. So, he wants that when a page is published, the USA branch has to see it first, and the Chinese branch to be the latest).

 

So, I have added a choice column called Priority  in my BranchesSites list, with just "1" or "2".

I added a parallel branch to retrieve the items depending on their Priority.

so I have the following :

 copy_flow_03.PNG

 

I have copied every action i'm doing to copy the page and edit its metadatas.

Except, I have came to a pretty and logic trouble :

 

TL;DR : 

I am using the same variables in both parallel branch.

So, of course, it went wrong. Because my variables are not synchronized and used in both case.

 

I will try to create separated variables for each branch, but do you have any idea to optimize my flow ?
Because I have 5 to 6 different variables to double. And my first steps of the flow will be too long, because i'm already initializing 11 variables, i will have 17 variables at the beginning !

Do you have any idea on how i could optimize these variables a bit (like, i don't know, sort of concataining ?) ?

 

Thanks a lot !

 

Have a nice day Smiley Happy

 

2 REPLIES 2
Super User
Super User

Re: Variables in parallel branches

Hi @Gaelle before I start going to far down the route of parallel branches, did you try changing the concurrency setting of the loop? By default it wil do one loop, then the next, and so on. If you make it concurrent, it will process multiple entries in one go, so you should be able to do all countries in a matter of seconds as opposed to minutes.

 

To find this option, click on the options ellipsis for your Apply to Each action, and then select Settings. Toggle the Concurrency Control to on and then up the degree of parallelism to be enough to do all your countries in one.

 

If that still doesn't cover what you want to do, then I'll build myself a demo with variables in parralel branches and see what I can do Smiley Happy

 

If you have found this post useful, please give it a thumbs up. If it has answered your question, please accept it as the solution so others can benefit.

@MattWeston365





Did my reply help? Please give it a thumbs up.
Did I answer your question? Please mark my post as a solution!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

Gaelle
Level: Powered On

Re: Variables in parallel branches

Hello @MattWeston365  !

 

Yes, I already set my "Apply to each" loop to be launched at the same time.

But throwing all my actions at the same time causes my Variables to be so wrongly set !

I am uses the same variables for each item, so if the actions are done at the same time, i will have wrong values.

Exemple :

What is happening :

I want to copy one page from Corporate Group intranet's SitePages library (https://mygroup.sharepoint.com/sites/Group-Intranet/SitePages/Title1.aspx) to SitePages libraries of both my Branch Sites, the variable "SitePagesID" is set to be France's when I want to use Japan's.

 

So, I don't really know how to do that.

 

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: 373 members 4,668 guests
Please welcome our newest community members: