0

I am initializing 2 array variables inside my power automate flow, when a SharePoint item is modified:-

johnjohnPter_0-1711119773948.png

then i am getting SharePoint list items, ApplyToEach on them, and inside each ApplyToEach iteration i am calling a child flow then append values to the 2 arrays based on the result of the child flow + value of the Apply to each, as follow:-

johnjohnPter_1-1711119907707.png

then after completing the ApplyToEach, i need to do some operations on the 2 array values.

now the "Concurrency control" is disabled inside the ApplyToEach:-

johnjohnPter_2-1711119961548.png

so is it fine if i enable it? for example to set it to 5? will it work with calling child flows and appending array variables based on the child flow result and based on the apply to each item value? or this might cause issues?

4
  • Does it work at the minute because concurrency control off means that it runs concurrently, you’re just not telling it how many at a time. If you want to control the concurrency, that’s when you flick that switch.
    – Skin
    Commented Mar 23 at 23:17
  • @Skin can you advice more on what you mean by "does it work at the minute"? Commented Mar 24 at 4:02
  • @Skin also think by default it operates sequentially Commented Mar 24 at 4:21
  • 1
    Interesting, I just tested and yes, you're right. I've had situations before where I've had to turn concurrency to 1 because the order of the items from the original array have come out differently with concurrency control turned off. I've been doing this for a long time and have never tested a basic array before to prove the concept but yes, you appear to be right.
    – Skin
    Commented Mar 24 at 6:26

2 Answers 2

1

I'm going out on a limb and saying that yes, it's fine to set the concurrency control to On.

I tested with two flows, one looked like this ...

Flow

... the other without the random delay and in both cases, the concurrency control was set to 20.

The original array of data looked like this ...

[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ]

These were the results ...

Scenario 1 (with random delay between 1 and 10 seconds)

[
  3,
  19,
  7,
  13,
  6,
  2,
  14,
  17,
  11,
  10,
  8,
  5,
  9,
  1,
  12,
  15,
  18,
  4,
  16,
  20
]

Scenario 2 (without delay)

[
  6,
  15,
  5,
  1,
  8,
  4,
  3,
  12,
  17,
  2,
  7,
  16,
  13,
  9,
  20,
  11,
  14,
  10,
  19,
  18
]

In both cases, the New Array variable still held all values, not missing anything.

I would think this would be the best way to test as well given it's doing very little compared to running off and taking a different time per child flow execution given levels of complexity, etc.

To be completely frank, I wouldn't expect Microsoft to create a non thread safe implementation for the concurrency functionality in PA so I guess this kinda proves it.

1
  • and i tested this on my end , and all the items representing the array were created , i tested on concurrency of 3 and of 5 Commented Mar 24 at 10:15
0

You should use the compose action, instead. That way you can turn the the concurrency to 50 if you want to (the only limit is the connector service)

A compose can be accessed outside of a loop as an array of its values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.