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