cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

I can't find the trigger I was using before. "when a new item is created"

Dear Community, please help me.
(I'm Japanese. I'm sorry if my poor English I mistaken.)


I builded an approval flow in SharePoint, using the trigger "when a new item is created" and REST service.


Next, I replaced The flow trigger with "When an item is created or modified".

(Because I wanted to incorporate a reapplication.)
Then a problem, Infinite loop occurred due to item update using REST service.
I tried to return the trigger to avoid the problem, but did not find the trigger "when a new item is created".


Please let me know if the trigger has disappeared from the flow ,And please let me know if you can prevent infinite loops.


Thank you for reading.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: I can't find the trigger I was using before. "when a new item is created"

The When an item is created trigger still exists, here's the documentation. To stop an infinite loop from occuring, you need to make sure that you are using a condition with a logical expression that prevents an infinite loop, such as a time-based expression.

Official Documentation

Blog Posts

If you provide detailed screenshots of your Flow, we may be able to provide further assistance. 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

v-lin-msft
Level 10

Re: I can't find the trigger I was using before. "when a new item is created"

Hello @Anonymous,

 

According to your reply, I think you have solved the problem of the create or modfied action disappearing and all that is left is to terminate the loop.

 

Here I to provide a method based on the new item creation time contrast creates an item on time to decide whether to create a new item, you can refer to this method of function, to create your flow.

 

Step1: Initialize two variable, one is array TimeList to storage time of item modifed, the other is Integer CountID set as the index of timeList, and please take a attention to set the Value as '-1'.Annotation 2019-05-13 105135.png

 

 

 

Step2: Create an action Apply to each, and append Time of modified to array TimeList. And increase CountID, value is '1'.

Annotation 2019-05-13 111202.png

 

Step3: Create a condition to determine whether the modification time of trigger is greater than one minute after the modification time of the previous item.

-If yes, create a new item or update item.

-If no, do nothing.

Annotation 2019-05-13 111619.png

The first blank:

formatDateTime(triggerBody()?['Modified'],'yyyy-MM-ddTHH:mm:ss')

The second blank:

addMinutes(variables('TimeList')[variables('CountID')],1,'yyyy-MM-ddTHH:mm:ss')

 

This way, the item created in the previous run can be avoided from triggering the loop to continue. Of course, if your flow takes a long time to run, you can set the time difference according to the actual situation.

 

Best Regards,

Community Support Team _ Lin Tu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

6 REPLIES 6
Super User
Super User

Re: I can't find the trigger I was using before. "when a new item is created"

The When an item is created trigger still exists, here's the documentation. To stop an infinite loop from occuring, you need to make sure that you are using a condition with a logical expression that prevents an infinite loop, such as a time-based expression.

Official Documentation

Blog Posts

If you provide detailed screenshots of your Flow, we may be able to provide further assistance. 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Anonymous
Not applicable

Re: I can't find the trigger I was using before. "when a new item is created"

Hi, @Brad_Groux 


Thank you for your response.

 

I was able to understand the cause, thanks to you telling me about "When an item is created" trigger still exists.

The cause of missing trigger is notation fluctaitons of English-Japanese translation.

Machine translation is the cause.
It was written as "アイテム" or "項目" on flow edit web page and an "item" on flow template web page.

SharepointTrigger.png

 

I'm thinking about a few solutions about infinite loops.
I will consider a little more about the solution to the infinite loop problem.
Please give us your advice if you have any ideas.

 

1.Build a logical expression based on the difference between two times.
(It use Item metadata "Approval apprication date")

 

2.I use other trigger in plece of a logical expression.

I build two flows for new and for editing and I don't use a logical expression.
Because I want to reduce flow usage count.

v-lin-msft
Level 10

Re: I can't find the trigger I was using before. "when a new item is created"

Hello @Anonymous,

 

According to your reply, I think you have solved the problem of the create or modfied action disappearing and all that is left is to terminate the loop.

 

Here I to provide a method based on the new item creation time contrast creates an item on time to decide whether to create a new item, you can refer to this method of function, to create your flow.

 

Step1: Initialize two variable, one is array TimeList to storage time of item modifed, the other is Integer CountID set as the index of timeList, and please take a attention to set the Value as '-1'.Annotation 2019-05-13 105135.png

 

 

 

Step2: Create an action Apply to each, and append Time of modified to array TimeList. And increase CountID, value is '1'.

Annotation 2019-05-13 111202.png

 

Step3: Create a condition to determine whether the modification time of trigger is greater than one minute after the modification time of the previous item.

-If yes, create a new item or update item.

-If no, do nothing.

Annotation 2019-05-13 111619.png

The first blank:

formatDateTime(triggerBody()?['Modified'],'yyyy-MM-ddTHH:mm:ss')

The second blank:

addMinutes(variables('TimeList')[variables('CountID')],1,'yyyy-MM-ddTHH:mm:ss')

 

This way, the item created in the previous run can be avoided from triggering the loop to continue. Of course, if your flow takes a long time to run, you can set the time difference according to the actual situation.

 

Best Regards,

Community Support Team _ Lin Tu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Re: I can't find the trigger I was using before. "when a new item is created"

Hello, @v-lin-msft 

 

Thank you for your response and wonderful idea.

I would like to combine you and my ideas to build a flow.

 

If you can see my idea (used the conditions on"if"), please see below.

flow分岐.png

 

 

v-lin-msft
Level 10

Re: I can't find the trigger I was using before. "when a new item is created"

Yes, I can see, and what' your problem during you use the flow?

Anonymous
Not applicable

Re: I can't find the trigger I was using before. "when a new item is created"

Hi, @v-lin-msft 

So far, so good. 

I will show you when this is complete. Thanks!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 108 members 4,702 guests
Please welcome our newest community members: