cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Radek1
Regular Visitor

Get file content from sharepoint

Hello,

 

I want to create a flow with a trigger when a file is created on sharepoint and use file content in next actions. So firstly I created "When a file is created in a folder" trigger, then I created a csv file and uploaded it:

 

Radek1_3-1632983957899.png

 

and everything went ok. I can see file content just fine.

 

Radek1_2-1632983851089.png

 

Now, I decided I need mail of person who created the file. I changed the trigger to "When a file is created (properties only)" and then used its dynamic functions to put "Identifier" in "Get file content". I expected the same result but the file content is different. 

 

 

Radek1_0-1632983583485.pngRadek1_1-1632983637681.png

 

What I need in the output is:

 

SIMF
ATSF
IMOF
BG1F

 

not

 

{
  "$content-type": "application/octet-stream",
  "$content": "U0lNRg0KQVRTRg0KSU1PRg0KQkcxRg0K"
}

 

How can I fix this?

1 ACCEPTED SOLUTION

Accepted Solutions
eric-cheng
Solution Sage
Solution Sage

Hi @Radek1 ,

 

This is because Get File Content will return the binary.

 

If you convert to base64 and then to string, you will see your original text

 

@base64ToString(base64(outputs('Get_file_content')?['body']))

 

ericcheng_0-1632988201928.png

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

 

 

View solution in original post

2 REPLIES 2
eric-cheng
Solution Sage
Solution Sage

Hi @Radek1 ,

 

This is because Get File Content will return the binary.

 

If you convert to base64 and then to string, you will see your original text

 

@base64ToString(base64(outputs('Get_file_content')?['body']))

 

ericcheng_0-1632988201928.png

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

 

 

View solution in original post

Radek1
Regular Visitor

Thanks @eric-cheng, I would have never fixed it myself.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,112)