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

Community site session details

Session Id : +OhOglnHKkojtpE6zLdR3a
Power Automate - Building Flows
Answered

Getting file path from shared OneDrive flow monitor

Like (0) ShareShare
ReportReport
Posted on 16 Oct 2019 22:37:56 by 17

I'm new to FLOW but loving it so far. My first project is as follows:

 

- I have a OneDrive Business folder shared with a bunch of my employees

- I have a working FLOW that posts to MS Teams an alert when someone adds or modifies a file in the shared OneDrive (including subfolders and that point is important).

- I included an email function to the flow to also email the same alert.

 

The issue: when I use the dynamic data component in the builder for File Path (has the OneDrive logo on it), it creates big coded path like this (which is fine if I can parse what I need):

 

/drives/b!hBza8tw8kkSnhMQ-lYa05Qz2YBR2IIBBjyb2cpQF7NrAmGg7uneOQ7RMXyfOoKyX/root:/Delray_Beach_Nw_Neighborhood_Improvements/Website_Content/New Text Document.txt

 

What I've been trying to do is to use some of the functions like split in a Compose to return the part of the path after "root:/" so that the users getting the alerts will know which folder the file was in. I know they can just read that part from the link, but I'd like it to be prettier than that.

 

I think the issue is that the triggerOutput "filepath" from the OneDrive monitor is coded like this: L2RyaXZlcy9iIWhCemE4dHc4a2tTbmhNUS1sWWEwNVF6MllCUjJJSUJCanliMmNwUUY3TnJBbUdnN3VuZU9RN1JNWHlmT29LeVgvcm9vdDovRGVscmF5X0JlYWNoX053X05laWdoYm9yaG9vZF9JbXByb3ZlbWVudHMvV2Vic2l0ZV9Db250ZW50L3Rlc3QgLSBDb3B5ICgyKS50eHQ=

 

I tried adding a compose with this: last(split(triggerOutputs()?['headers']['x-ms-file-path-encoded'],'root:/'))

then sending that output in the email, but the output of the compose is just the coded filepath (blue above) instead of it decoding it.

 

Why is the dynamic file path component decoded if I use it in the email function but I not when I use it in the compose function? Any ideas how I can do this?

 

THanks all!

I have the same question (0)
  • bcontento Profile Picture
    17 on 16 Oct 2019 at 22:50:12
    Re: Getting file path from shared OneDrive flow monitor

    Nevermind! I figured it out:

     

    last(split(base64ToString(triggerOutputs()?['headers']['x-ms-file-path-encoded']),'root:/'))
  • Verified answer
    v-bacao-msft Profile Picture
    on 17 Oct 2019 at 03:12:21
    Re: Getting file path from shared OneDrive flow monitor

     

    Hi @bcontento ,

     

    You could remove -encoded and use the following expression:

    last(split(triggerOutputs()?['headers']['x-ms-file-path'],'root:/'))

     

    Best Regards,

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 666 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 382 Moderator

#3
developerAJ Profile Picture

developerAJ 254

Last 30 days Overall leaderboard