web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Onedrive for Business:...
Power Automate
Answered

Onedrive for Business: "When a file is created trigger

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello there, 

 

I was trying to use the trigger above to start the process but it keeps throwing up an error. The files in the folder are just excel files, titled as such: Employee Number- Non Sensitive YYYY-MM-dd mm_ss.

 

Any ideas?

 

Thanks!

 

Here's a screenshot of the flow:

Screenshot 2021-08-18 142010.png

And the screenshot of the output:

amist15_1-1629264820324.png

 

Categories:
  • v-LilyW-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous 

    Thank you for posting.

    From the screenshot you provided, the statusCode shows 200, indicating the trigger is running successfully.

    Are there any other errors?

    If there is an error, there will be a red exclamation mark in the upper right corner, and there will be an error message on the right ,like this:

    vLilyWmsft_0-1629272860841.png

    Best Regards.

  • Mitanshu Profile Picture
    1,658 Moderator on at

    What is the error message that you are getting? 🤔 From the output that you are showing in screenshot, it looks your Trigger was successful.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi both, thanks for replying..

     

    Sorry I'm still new to this! So the trigger works, and I've used file name contains in my condition but it never seems to trigger if yes. In the screenshot below, I definitely have an excel file starting with Learning Completions, but it always flows through to NO and I can't seem to find out why. 

    amist15_0-1629278235032.png

    amist15_1-1629278379250.png

     

  • Mitanshu Profile Picture
    1,658 Moderator on at

    Create a Compose action and add a Expression as below

    triggerOutputs()?['headers']?['x-ms-file-name']
     
    You can use this in the Condition also.
     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi there, thanks for replying so quickly!

     

    Do you mean like this? Also, what is the error this time and what does that expression do? I've use file identifier or name in other flows before with no issues so I'm trying to understand what the issue here is..

     

    Thanks!

    amist15_0-1629282691732.png

     

     

     

  • Mitanshu Profile Picture
    1,658 Moderator on at
    triggerOutputs()?['headers']?['x-ms-file-name'] is a reliable way of getting File name from OneDrive -> When an item is Created trigger.
     
    See below on where you should be writing the expression.

     

    happyume_0-1629282893679.png

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks!

     

    I've managed to get the feed into the next step: "condition"

     

    Here's the error I encounted. I've never encountered such errors before, I don't even know where to start troubleshooting

     

    amist15_0-1629283810305.png

     

     

    {
      "status": 400,
      "message": "The file id 'Learning Completions - 21 June 2021-08-18 08_03.xlsx' is not valid.",
      "source": "api.connectorp.svc.ms"
    }
     
    {
      "Pragma": "no-cache",
      "Transfer-Encoding": "chunked",
      "x-ms-request-id": "b59398d3-f160-4b33-9b8a-9b4bd2b21313",
      "Timing-Allow-Origin": "*",
      "x-ms-apihub-cached-response": "true",
      "Cache-Control": "no-cache",
      "Date": "Wed, 18 Aug 2021 10:46:42 GMT",
      "X-AspNet-Version": "4.0.30319",
      "X-Powered-By": "ASP.NET",
      "Content-Type": "application/json",
      "Expires": "-1",
      "Content-Length": "161"
    }
  • Verified answer
    Mitanshu Profile Picture
    1,658 Moderator on at

    I believe your original query regarding trigger is now resolved - please can you accept the solution as it would help other users (who may have same problem) in finding an answer.

     

    For your new issue, you should ideally create a new thread. Under the Move or Rename a File action, are you using File Identifier for the File, or something else?

     

    happyume_0-1629284089882.png

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 331 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard