web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help with Incremental ...
Power Automate
Answered

Help with Incremental Variable

(0) ShareShare
ReportReport
Posted on by 29

Hello All,

 

I am fairly new to Power Automate and stuck in a situation and hoping I can get some help. The flow works ok when just one email is processed but during the test of my application, i discovered of more than one email arrives, only one is processed and below is my requirement. which works if its just one email.

 

1 - when an email arrives, an item is created in share point list through flow

2- I need to create a unique ID for the record (SharePoint ID not sufficient)

       a- Get the max ID for the column (Case_ID)

        b- Create a variable to store the value

        c - set a variable for the new ID + 1 

        d -Update the created item with the new value from Step c

 

as mentioned above, it work if just one email but when two emails come in seconds apart, it creates one Case_ID but ignores the other.

 

i know am doing something wrong but don't know what it is. here is a screen shot of my flow

 

adewunmis_0-1699884898589.png

 

 

Categories:
I have the same question (0)
  • Srini007 Profile Picture
    3,327 Super User 2025 Season 2 on at

    Hi @adewunmis 

     

    By seeing you flow you need to place everything into Apply to Each to work for multiple emails

     

           a- Get the max ID for the column (Case_ID)

            b- Create a variable to store the value

            c - set a variable for the new ID + 1 

            d -Update the created item with the new value from Step c

     As, above steps will apply for each email, then place inside Apply to each not outside the Apply to each

     

    As, you shared not expanded actions, so I don't know more info

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Regards,

    Srini

     

  • adewunmis Profile Picture
    29 on at

    Thanks @Srini, here is my expanded flow attached. what do you mean by placing everything into Apply to Each 

  • adewunmis Profile Picture
    29 on at

    adewunmis_0-1699886767885.pngadewunmis_1-1699886777697.pngadewunmis_2-1699886790921.png

     

  • adewunmis Profile Picture
    29 on at

    Hi there, its still not working even after putting everything in the Apply to Each to each. i now get an error on the update items step. its using the value from the variable ( when multiple email sent) thus creating duplicate so if two email are sent, one flow succeeds while the other fails due to that duplicate

     

    Thanks 

     

  • Verified answer
    Barret Profile Picture
    652 Most Valuable Professional on at

    Just a guess, but check to ensure that you have turned on Concurrency setting in your Apply to each action and set the Degree of Parallelism to 1. By default, multiple instances of an Apply to Each loop will run in parallel. What that means is that if you have 2 emails, it will spawn 2 loops, one for each email, that will run at the same time. Both loops make the call to get the max Case ID. Both will likely get the same result, causing each to add 1 to that value and try to save a new case with the same ID number. First one works, second fails because it was too slow.

     

    To change your concurrency setting, click the ellipsis (the 3 dots ... ) at the top right corner of the Apply to each box and select "Settings" from the dropdown menu. You'll see a toggle for Concurrency Control. Switch that to the "On" position. That will make a slider appear for the "Degree of Parallelism". Change the slider value to 1, then click Done.

  • adewunmis Profile Picture
    29 on at

    Hi, thanks for your response, yes its set but still does the same. here is a screen shot of what i currently have, perhaps am missing something else.

     

    adewunmis_2-1699909144170.png

     

    update item 2 is where its failing when multiple emails come in

     

    below is what i have for apply to each 

     

    adewunmis_1-1699909049852.png

     

    Thanks a lot 

     

  • adewunmis Profile Picture
    29 on at

    Can anyone please suggest how to address this issue please?

  • adewunmis Profile Picture
    29 on at

    Hello Barret, thanks for your suggestion and pointing me in the right direction ,after trying the Concurrency settings at the apply to each without success, it worked at the start of the flow trigger ( when a new email arrives)

     

    Thank you and to everyone 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard