SOLVED

Microsoft Flow And Remote Event Receivers

%3CLINGO-SUB%20id%3D%22lingo-sub-109034%22%20slang%3D%22en-US%22%3EMicrosoft%20Flow%20And%20Remote%20Event%20Receivers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-109034%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20set%20up%20a%20Microsoft%20Flow%20on%20a%20SharePoint%20Online%20site%20that%20creates%20an%20item%20on%20a%20list%20I%20have%20an%20existing%20(working)%20Remote%20Event%20Receiver.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20the%20flow%20creates%20the%20item%20in%20the%20list%2C%20the%26nbsp%3BRER%20is%20not%20getting%20fired%20off.%20%26nbsp%3BWhen%20I%20manually%20(i.e.%20through%20the%20SharePoint%20UI)%20create%20an%20item%20in%20the%20list%20the%20event%20is%20fired.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20this%20expected%20behavior%3F%20Is%20there%20a%20way%20to%20force%20the%20event%20to%20fire%20through%20Flow%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-109393%22%20slang%3D%22en-US%22%3ERe%3A%20Microsoft%20Flow%20And%20Remote%20Event%20Receivers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-109393%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F20639%22%20target%3D%22_blank%22%3ESuleyman%20Ayazalp%3C%2FA%3E%2C%20Thank%20you%20for%20forcing%20me%20to%20look%20at%20logging.%20%26nbsp%3BI%20had%20completely%20forgotten%20that%20I%20was%20trapping%20on%20%22Updated%22%20tasks%20only%2C%20and%20not%20%22Created%22%20tasks.%20So%2C%20while%20I%20had%20lots%20of%20logging%20for%20what%20happens%20when%20things%20were%20updated%2C%20I%20wasn't%20getting%20anything%20in%20my%20%22Updated%22%20routing.%20%26nbsp%3BSo%2C%20once%20I%20added%20the%20logging%20per%20your%20suggestion%2C%20I%20realized%20the%20error%20of%20my%20ways.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-109173%22%20slang%3D%22en-US%22%3ERe%3A%20Microsoft%20Flow%20And%20Remote%20Event%20Receivers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-109173%22%20slang%3D%22en-US%22%3E%3CP%3EAre%20you%20100%25%20sure%20that%20it's%20not%20fired%3F%20I%20am%20asking%20this%20because%20we%20were%20facing%20a%20similar%20situation.%20In%20our%20case%20it%20was%20an%20other%20app%20that%20was%20performing%20an%20action.%20It%20was%20authenticating%20using%20client%20id%26nbsp%3Band%20client%20secret.%20The%20event%20actually%20did%20fire%20but%20failed%20at%20authentication.%20We%26nbsp%3Bfollowed%20an%20example%20from%20PnP%20and%20it%26nbsp%3Bwas%20trying%20to%20authticate%20using%20the%26nbsp%3Breceived%20accesstoken.%20When%20the%20event%20was%20fired%20by%20an%20app%20it%20was%20not%20receiving%20a%20correct%20accesstoken%20to%20be%20able%20to%20authenticate.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20switched%20to%20app%20only%20authenication%20(as%20fallback%20authentication%20method)%20using%20client%20id%20and%20secret%20to%20overcome%20this%20issue.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETry%20putting%20some%20logging%20before%20creating%20the%26nbsp%3Bclient%20context%20and%20see%20if%20the%20remote%20event%20receiver%20is%20called.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGood%20luck!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-109166%22%20slang%3D%22en-US%22%3ERe%3A%20Microsoft%20Flow%20And%20Remote%20Event%20Receivers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-109166%22%20slang%3D%22en-US%22%3EMay%20I%20ask%20what%20are%20you%20trying%20to%20achieve%20combining%20Flow%20and%20Remote%20Event%20Receivers%3F%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I am trying to set up a Microsoft Flow on a SharePoint Online site that creates an item on a list I have an existing (working) Remote Event Receiver.

 

When the flow creates the item in the list, the RER is not getting fired off.  When I manually (i.e. through the SharePoint UI) create an item in the list the event is fired.

 

Is this expected behavior? Is there a way to force the event to fire through Flow?

3 Replies
Highlighted
May I ask what are you trying to achieve combining Flow and Remote Event Receivers?
Highlighted
Best Response confirmed by Charles Willwerth (Occasional Contributor)
Solution

Are you 100% sure that it's not fired? I am asking this because we were facing a similar situation. In our case it was an other app that was performing an action. It was authenticating using client id and client secret. The event actually did fire but failed at authentication. We followed an example from PnP and it was trying to authticate using the received accesstoken. When the event was fired by an app it was not receiving a correct accesstoken to be able to authenticate.

 

We switched to app only authenication (as fallback authentication method) using client id and secret to overcome this issue. 

 

Try putting some logging before creating the client context and see if the remote event receiver is called. 

 

Good luck!

Highlighted

Suleyman Ayazalp, Thank you for forcing me to look at logging.  I had completely forgotten that I was trapping on "Updated" tasks only, and not "Created" tasks. So, while I had lots of logging for what happens when things were updated, I wasn't getting anything in my "Updated" routing.  So, once I added the logging per your suggestion, I realized the error of my ways.