cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Community Support
Community Support

 

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
Frequent Visitor

Nevermind! I figured it out:

 

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

 

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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (45,870)