cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HimanshuSSharma
Resolver I
Resolver I

Problem in Using a Trigger: When a new email arrives (V3)

I created a flow to copy attachments from email to a one drive folder. I started with using the "When a new email arrives (V3)" of the Office 365 Outlook type. It is able to create a file that is corrupted and of size 4 bytes.

There is also a template that does exactly the same thing but is using (V2) of the same connector type. It works perfectly fine with the same steps that I applied before. Is this supposed to be a bug in the (V3)? How to make a flow using V2 since V3 is not working?

How I know template is using V2:

Peek code of V3 from my custom flow:

{

    "inputs": {

        "host": {

            "connectionName": "shared_office365",

            "operationId": "OnNewEmailV3",

            "apiId": "/providers/Microsoft.PowerApps/apis/shared_office365"

        },

        "parameters": {

            "folderPath": "Inbox",

            "includeAttachments": false,

            "subjectFilter": "POCOM File Daily Dump",

            "importance": "Any",

            "fetchOnlyWithAttachment": true

        },

        "authentication": "@parameters('$authentication')"

    },

    "splitOn": "@triggerOutputs()?['body/value']"

}

Peek code of V2 from template flow:

{

    "inputs": {

        "host": {

            "connection": {

                "name": "@parameters('$connections')['shared_office365']['connectionId']"

            }

        },

        "method": "get",

        "path": "/v2/Mail/OnNewEmail",

        "queries": {

            "folderPath": "Inbox",

            "importance": "Any",

            "fetchOnlyWithAttachment": true,

            "includeAttachments": true

        },

        "authentication": "@parameters('$authentication')"

    },

    "recurrence": {

        "interval": 3,

        "frequency": "Minute"

    },

    "metadata": {

        "flowSystemMetadata": {

            "swaggerOperationId": "OnNewEmailV2"

        }

    },

    "splitOn": "@triggerBody()?['value']"

}

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

If you ook at your Peek Code you will notice the other difference is that IncludeAttachments is set to true in the V2 version and set to false in the V3 version.  I suspect that is your problem, not the difference between v2 and V3



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
Pstork1
Dual Super User III
Dual Super User III

If you ook at your Peek Code you will notice the other difference is that IncludeAttachments is set to true in the V2 version and set to false in the V3 version.  I suspect that is your problem, not the difference between v2 and V3



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

HimanshuSSharma
Resolver I
Resolver I

@Pstork1 Thanks for your response. This was the issue, I feel a bit stupid now.

One more catch for me: When you make any change in the trigger, do not test the flow using automatic trigger from previous runs. In my case, it was still using the old format trigger when using attachments was false.

Don't feel too stupid, I've done it myself many times.  Its very common that someone else will see something obvious that you missed because your eye is expecting something.  But your comment about testing is a good point.  Don't ever use previous runs for testing if you've added a new connector or changed the existing connector (the trigger).  It will often give a false test.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (100,636)