cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
smorley
Helper V
Helper V

Trigger condition syntax for a SharePoint list item flow on create or modified

Hi PAers!

 

I'm trying to prevent an infinite loop for an item that is created or modified.

 

All the workflow is supposed to do is update a number field under certain conditions.

 

The number field that is being updated is called Teaching Time.  It will either be updated with the value in field Activity Length if it's a lecture or with the field Seminar Total Hours if it's a Seminar.

conditions.jpg

As it is this works fine, but it does go into an infinite loop.

 

What I want to do is create a trigger condition that has the logic of:

 

If Teaching time is not equal to Activity length or Teaching Time is not equal to Seminar Total hours.  I'm running into syntax errors with the triggers that I've tried so far.

 

Help as always, is appreciated.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@smorley , thank you for the information that 'Do until' can be used for the same purpose, I didn't know about that one.

It's strange that it doesn't show the other dynamic content, what if you switch the Teaching time and Activity Length, will it show the Activity Length correctly? Maybe you could compose it by yourself in a text editor if it doesn't show both the dynamic contents at the same time.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

4 REPLIES 4
tom_riha
Super User
Super User

Hello @smorley ,

you can use the 'Filter array' action to build the trigger condition. Add 'Filter array' right after the trigger, use the interface to define the condition, and then switch to 'advanced mode'. The action will convert the condition into a text.

Do this for both of the conditions, remove the leading @ from both, and then connect them with @or(...) for the trigger condition.

@or(condition1, condition2)


[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Hi @tom_riha - I usually use "Do Until" to do the same thing as filter array.

 

In this scenario, here's what my filter array displays.

 

filterarray.jpg

 

When I switch to advanced mode, this is what it displays:

@not(equals(triggerOutputs()?['body/Teaching_x0020_time'], triggerOutputs()?

 

It's not picking up the Activity length.

@smorley , thank you for the information that 'Do until' can be used for the same purpose, I didn't know about that one.

It's strange that it doesn't show the other dynamic content, what if you switch the Teaching time and Activity Length, will it show the Activity Length correctly? Maybe you could compose it by yourself in a text editor if it doesn't show both the dynamic contents at the same time.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

That's what I did @Tom - I also signed up for your weekly digest.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,184)