cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Getting file path from shared OneDrive flow monitor

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

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,

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

View solution in original post

2 REPLIES 2
Highlighted
Frequent Visitor

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:/'))
Highlighted
Community Support
Community Support

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,

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

View solution in original post

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,219)