cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bcontento
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
v-bacao-msft
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
bcontento
Frequent Visitor

Nevermind! I figured it out:

 

last(split(base64ToString(triggerOutputs()?['headers']['x-ms-file-path-encoded']),'root:/'))
v-bacao-msft
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.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (4,596)