cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tsyrell
Level: Powered On

SharePoint When File is Created trigger not triggered

I am building a flow that triggers when an new file is added to a SharePoint library.  I did not want to impact the current work library, so I build my own test version.  All worked well, so I repointed the flow to the work library.  At that point, the flow is no longer triggered when a new file gets added.  I am assuming that there is some difference between the test library that I created, and the active work version.   I reviewed all of the settings and adjust my test version to match. I then created a simple flow that triggers on a new file creation and sends me an email with the file name.  The flow works perfectly against my test library, but again, when I repointed to the work version, the flow never triggered.

 

Any thoughts?

 

 

 

 

16 REPLIES 16
Community Support Team
Community Support Team

Re: SharePoint When File is Created trigger not triggered

Hi @tsyrell ,

 

Have you take a try to create a flow with your current work library directly?

 

Best regards,

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

tsyrell
Level: Powered On

Re: SharePoint When File is Created trigger not triggered

Hi Alice, 

 

Yes, I tried the simple trigger flow directly against the work library, and it doesn't execute when a new file is added.  When I repoint it to my test library and add a new file, the flow is executed.

Super User
Super User

Re: SharePoint When File is Created trigger not triggered

THis is just an idea, since the reason isnt obvious... but, have you tried to delete to trigger action, and re-create it?  I have had that fix many unknown issues.  Even when re-created with the exact same things!

 

 

tsyrell
Level: Powered On

Re: SharePoint When File is Created trigger not triggered

I just tried the following:

  1. started fresh pointing to the work library triggering on new file creation
  2. added a file to the work library
  3. trigger did not execute
  4. repointed the trigger step to the test library
  5. added a file to the test library
  6. trigger executed and sent email
  7. repointed the trigger step back to the work library
  8. added a file to the work library
  9. trigger failed to execute again

Any other thoughts?

 

Super User
Super User

Re: SharePoint When File is Created trigger not triggered

@tsyrell ,

 

Please check this...  I dont have time at the moment or I would, but SQL table triggers require a column to be indexed.  I would not expect that to be true for sharepoint, but perhaps that is an issue.  See if you sample has an indexed column and that indexing is enabled, as well as your active list you wish to trigger from.

tsyrell
Level: Powered On

Re: SharePoint When File is Created trigger not triggered

Thanks for the suggestion.  That was actually one thing I had checked yesterday when I was reviewing both libraries for any differences in their attributes.  The work document library had two indexes created (Created and Created By) that were flagged as automatically created.  I went ahead and created those for my test library to see if it caused it to fail, and that had no affect.  I deleted them just now on my test library and the trigger still executed when I added a document. 

Super User
Super User

Re: SharePoint When File is Created trigger not triggered

Wow, at this point, it seems like we need to backup a bit and do some other basic checking.  You might replace your trigger with a "button" (Manually Trigger a Flow)  so you can start this manually.  Do a simple Get Item from the sharepoint list to at least verify your connector.  Use any ID number from an existing item, just to see if it loads.  Then we can go from there.

 

I'm sorry if this is too fundamental, I dont want to insult your intelligence... but this is very strange.  I have seen many strange things in this system.  Something that "should" work but does not.  

tsyrell
Level: Powered On

Re: SharePoint When File is Created trigger not triggered

No concerns at all.  I am relatively new to flow, so I am all ears.  I will say though, that this flow issue is on a library not a list.  I have a similar flow which triggers on a new item in a list, and that works correctly.  Is there a way to manually trigger a flow on a document?  I'm not seeing anything related to SP triggers that would seem to allow for a manual trigger.

 

The only set-up diferences that I can see between the work documents library and my test library are that I had to reindex the work documents library because of its size (was close to 4000 documents before we archived ~2000) causing search issues.  I am assuming that the reindex created the two indexes (Created and Created By) I mentioned earlier.  My test library didn't have those indexes.  I also checked a Governance Documents Library within the same site.  That was never manually reindexed, so it didn't have any indexes.  I repointed my test flow to that library and it worked correctly.

 

I've gone ahead and requested a reindex on both the Governance Documents library and my test library to see if that causes the problem.  

 

 

Super User
Super User

Re: SharePoint When File is Created trigger not triggered

Yes, you did state clearly that its a document library.  There is a trigger for both types, so its all good..

 

What I wanted to have you do is create a manual trigger for you to just run your flow with "test" and not require a document drop.  Then, do a Get File Properties (in your case) and see if you can at least pull in an item into flow.

 

You mentioned the library size.  This point has been one that is a bit troubling to me.  Size does mattter...  Exceeding 2,000 is a bogie in powerapps for the whole "delegation" thing.  I could see it possible that the size of the library may fall off the stack and miss triggering.  The question is... "why?" and that I just do not know.  

 

Do try this quick manual check to see if you can "Get" an record from the library.

 

image.png

tsyrell
Level: Powered On

Re: SharePoint When File is Created trigger not triggered

Yes, that ran successfully.  I have been successfully reading docs from that library, as I wrote the archive flow which runs in the morning, and moves files greater than 6 months old to an archive library.  

Super User
Super User

Re: SharePoint When File is Created trigger not triggered

At this point... i'm thinking its something to do with the number of records.  Did you say you have more than 2,000 now?

 

I'm going to setup a trigger in my document library that has over 5,000 items, and see what happens.  It will send me e text when an item is created.

tsyrell
Level: Powered On

Re: SharePoint When File is Created trigger not triggered

Yes, the work document library has 2071 files.  I repointed the test flow (when file is created then send notification email) to our Archive library which has 1924 files (archived from the work document library), and that worked as expcted when I added a file. 

 

That library had also not bee reindexed.  I set that up for as well for the next scheduled crawl, so we'll see if that has any impact.

Super User
Super User

Re: SharePoint When File is Created trigger not triggered

Ok, I have recreated the exact scenario as you.  At least, it seems.

 

I created a trigger on new items to a library of over 5,000 items.... completely DEAD!  Nothing...

 

I moved the folder reference to a library with just a few items and BAM!  Worked right away.  

 

The number 2,000 is a bogie for many things powerapps/flow, etc.  Interesting that a "SQL Get Rows" is also limited to 2,000.  It seems to be a trait that is not well documented, except in Powerapps where you actually get feedback when you have a condition where you get "delegation" warnings.  It certainly does have an implact on scalability.  Its hard to know what you can and cannot do when your data sources get large.  It doesnt seem to be an issue for my app, since I have been able to write everything in PA that do not have delegation problems.  (Regarding my >5,000 issue).  However, I know I have an issue with one of my sources where I have to do many complex searches.  For that one, I have used a method that actually allows for 4,000 items.  I can get you to that info if you need it.

 

Regardless, I think we have the issue identified.  However, not solved.  I do not know how to get around this for this trigger action.  Perhaps a MSFT staff person can comment???

 

image.png

tsyrell
Level: Powered On

Re: SharePoint When File is Created trigger not triggered

Thanks @martinav , I am extremely appreciative of your debugging efforts!  I'm going to modify the archive flow to move a few more weeks of older files to try to get under the 2000 file limit and see what that does.  Hopefully that will work in the interim until a better solution is presented.  I will let you know if I'm successful.

Super User
Super User

Re: SharePoint When File is Created trigger not triggered

Sounds good.  Please do report back.  It would be nice to know if this 2,000 limit is a real thing for this trigger.  I havent found that this is published anywhere.  It should be.  It is not an accident, and people need to know about this sort of thing before they get a process ingrained in their processes, and then things suddenly stop when their databases get big.

 

In my case, I cannot move files around.  ALL of them are viable.  They are all active drawings.  Thus, I have to do things that circumvent these limits.  I know that I have a problem at 4,000 items in one of my databases.. I'm at about 2,400 and probably about 3 years from that point.  By then, I hope the system has evolved, or I will have to find alternatives.

 

Best of luck!

tsyrell
Level: Powered On

Re: SharePoint When File is Created trigger not triggered

I modified my archive to get below the 2000 file limit, and the test still didn't work.  I then attempted to create a brand new test flow just to make sure that there wasn't any residual problem with the test flow, and noticed a different msg than I had see before. Because I have a notification step, I always see this msg and have completely ignored it:

Capture1.PNG

 

When I ran the new test, I noticed a different msg there:

Capture2.PNG

After clicking on the details, I saw the dreaded column threshold error. Once I fixed that, the test worked.  

 

I restored files to get back over the 2000 number, and ran a couple of tests with mixed results, so it still appears that that number can be an issue.  At this point, I think my flow is working, but will be testing more next week and will publish the results.

 

Thanks again @martinav for all of your help!

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate 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 Power Automate Community Video Gallery!

Users online (5,188)