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 / New designer issue - A...
Power Automate
Unanswered

New designer issue - Avoiding recursive loops

(0) ShareShare
ReportReport
Posted on by 163

I have a basic workflow which relates to a Sharepoint list with one text field and one (single select) choice field.

The workflow consists of:
Sharepoint Trigger - When an item is created or modified

Get item - using id from trigger

Condition statement  - testing whether the "modified by email" was the system email account (under which I wrote the workflow)

If true then terminate

If false then update item

  

Prior to the new designer layout I have written all my workflows to test the "Modified by email"  to avoid recursive loops and terminate the workflows and everything was fine, I could test the "Modified by in either the trigger or the Get item action. No problem.

 

However in the new designer world If I add a Get item action under the trigger it immediately wraps it in a "For each" loop, my condition statement then causes the workflow to fail with : 
'The template language expression 'body('Get_item')?['Editor']?['Email']' cannot be evaluated because property 'Editor' cannot be selected. Array elements can only be selected using an integer index.

Alternatively if I point my condition statement to the modified by email field trigger then the designer encapsulates that into a for each loop and I can't subsequently have a terminate statement inside that.

I have tried switching to classic designer and it does exactly the same thing. 
What has changed and how do we now go about avoiding recursive loops?

 

Many thanks

Pointing at Get item.png
Pointing to trigger - Modified by email field.png
Categories:
I have the same question (0)
  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Try this as the expression in your condition. No need to "Get Item". 

     

    triggerOutputs()?['body/value'][0]?['Editor/Email']

     

    Rhiassuring_0-1701809269505.png

     

     

    Or,  you could just use it as a trigger condition (available through the Settings in the Trigger) and forego the condition in the flow entirely: 

     

    @not(equals(triggerBody()?['value'][0]?['Editor/email'],'rhia@email.com'))

     

    This means it will only run if the Modified By is NOT "rhia@email.com".

     

  • David_MA Profile Picture
    13,868 Super User 2026 Season 1 on at

    If one of @Rhiassuring's suggestions does not work, you can switch to the old designer by clicking on the three dots at the top-right of the screen:

    David_MA_0-1701810207259.png

    Of course, I don't know how long this will be allowed until we're all forced to use the new designer. Are you enjoying the new designer? It seems like a step backward to me.

  • wskinnermctc Profile Picture
    6,519 Moderator on at

    @Ian_C Why do you need to use a "Get Item" action? The outputs should be the same for the trigger as the Get Item. Seems to be redundant.

    Doesn't solve your apply to each issue, but curious about needing to use Get Item.

  • Ian_C Profile Picture
    163 on at

    @wskinnermctc Hi, I used the "Get item" action on occasion where I've needed to change the trigger, plus it also makes for easier visual debugging.

  • Ian_C Profile Picture
    163 on at

    @Rhiassuring Thanks I'll give this a go and report back

     

  • Ian_C Profile Picture
    163 on at

    @David_MA Thanks I tried switching back using the three dots however this still had the same effect. 
    It's like the Sharepoint Trigger - When an item is created or modified and the  Get item action - using id from the trigger are returning arrays rather than the single item.

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    That was happening to me as well (wanted to see what would happen if I switched with that flow.) I think you'd need to build it from scratch in Classic to not experience the weird "get item" situation.

  • Ian_C Profile Picture
    163 on at

    @Rhiassuring Thanks, the option to build from classic seems to be no longer available, selecting create automatically starts the new designer

     

  • Ian_C Profile Picture
    163 on at

    Thanks @Rhiassuring  your code in the condition works so I can stop the recursive loops. 

    I tried putting your code into the trigger settings so that I wouldn't need the condition check 

    and it fails with 
    Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language expression 'triggerOutputs()?['body/value'][0]?['Editor/Email']' cannot be evaluated because property '0' cannot be selected.

     

    This seems to indicate that the trigger is not returning an array however if you do a subsequent "Get Item" or "Update Item" referencing the ID from the trigger it puts the action within a "For each" loop - Most odd.

     

     

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Hi @Ian_C  - note that the formulas I posted are for 2 different scenarios. One for if you continue to use a condition, and one for if you user the trigger condition.

     

    The trigger formula is this one:  

     

    @not(equals(triggerBody()?['value'][0]?['Editor/email'],'rhia@email.com'))

     

    I've just double checked, and it's valid but what I have found, is that you can't "test" for it.

     

    Like, if you set the trigger condition and then click "Test" and Automatically or Manual, it won't operate correctly. (Which I think is another thing that has changed lately, as I swear I used to test trigger conditions manually all the time..)

    Save it, and go modify something in the library, and see if it runs. In my circumstance, it didn't run when I edited an item as myself, but it did run when Tom Hanks edited the item.

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 77 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 68

#3
Expiscornovus Profile Picture

Expiscornovus 56 Most Valuable Professional

Last 30 days Overall leaderboard